Contents

The Box Analogy

When looking for 4-cycles (for instance) we have 4 'a' values such that the sum a1 to a4 is less than or equal to m. For m = 7, the smallest 's' value will be when all the 'a's but the last one are 1, giving (1,1,1,4). For the box analogy we are going to subtract all 1 from all the a values, so the starting point is now (0,0,0,3). We can imagine the point (0,0,0,3) as a row of 4 boxes with all three beads in the 4th. We can generate all the other valid permutations by moving beads, one at a time, from the 4th box to the others. Moving a bead from box 4 to one of the others will increase the value of 's' as defined in the following table:

To Box Increment
1 9×2(1+a1) + 3×2(2+a1+a2) + 2(3+a1+a2+a3)
2 3×2(2+a1+a2) + 2(3+a1+a2+a3)
3 2(3+a1+a2+a3)

The order we move the beads doesn't matter as the final value of s depends only on the number of beads in each box, not how they got there. So if we start moving beads first into box1, then box 2, then box 3 the calculations will be simpler (because when we are moving beads into box1, a2 and a3 will be 0). And when we move beads into box2 a3 will still be 0. The simplified table is

To Box Increment
1 9×2(1+a1) + 3×2(2+a1) + 2(3+a1)
2 3×2(2+a1+a2) + 2(3+a1+a2)
3 2(3+a1+a2+a3)

If we factor out the constant parts we get

To Box Increment
1 2(a1) x (9×2 + 3×4 + 8)
2 2(a1+a2) x (3×4 + 8)
3 2(a1+a2+a3) x (8)

The Table Puzzle

For n=4, m=7, the starting value with all the beads in box 4 is 65 (3n - 2n). The increments shown in the above equations are used to populate the tables below. The shaded cells show possible moves. In the first we move 1 bead into box 1 and then 2 beads into box 2. The result is 65+38+40+80 = 223. In the second we just move 2 beads to box 3, giving 65+8+16 = 89.

Move Increment
65 box 1 box 2 box 3
1 38 20 8
2 76 40 16
3 152 80 32
Move Increment
65 box 1 box 2 box 3
1 38 20 8
2 76 40 16
3 152 80 32

The first move must be from row 1, the second from row 2, etc. Once you've used a box you can't use any of the boxes to the left of it. You can stop whenever you like, the objective is to form a total, including the starting value, that is a multiple of 2m-3n. In this example that is 27-34=47. In the above table there are no solutions, if there were we would have found a 4-cycle in 3x+1.

If we add a few more rows though, we can find some solutions, but the constraint on the number of beads is broken. For example, the tables below illustrate

65+8+16+32+64+128+256+512        = 1081 = 23 × 47
65+38+40+80+160+128+256+512+1024 = 2303 = 49 × 47

There is no obvious reason, therefore, why this puzzle should be impossible, but to find a solution for any valid combination of 'm' and 'n' would be to find a loop in 3x+1.

Move Increment
65 box 1 box 2 box 3
1 38 20 8
2 76 40 16
3 152 80 32
4 304 160 64
5 608 320 128
6 1216 640 256
7 2432 1280 512
8 4864 2560 1024
Move Increment
65 box 1 box 2 box 3
1 38 20 8
2 76 40 16
3 152 80 32
4 304 160 64
5 608 320 128
6 1216 640 256
7 2432 1280 512
8 4864 2560 1024

Generating The Tables

For 5 cycles, m=8, m-n=3, 2m-3n is 13 and 3n - 2n is 211. We now have 5 boxes and start with 3 beads in the 5th. The increments are:

Box Increment
1 2(a1) x (27×2 + 9×4 + 3×8 + 16)
2 2(a1+a2) x (9×4 + 3×8 + 16)
3 2(a1+a2+a3) x (3×8 + 16)
4 2(a1+a2+a3+a4) x (16)

If we look at the terms in the 4th column we will notice that they follow the pattern 

(81-16)×2, (27-8)×4, (9-4)×8, (3-2)×16.

essentially because the sum of the terms (2i × 3(n-i)) over i is 3(n+1) - 2(n+1). This makes it easy to generate an arbitrary table. For a given row and column (r,c), starting at (0,0) the value is

[r,c] = (3(n-1-c) - 2(n-1-c)) × 2(1+r+c)

For a given pair of n and m values c will range from 0 to n-2 and r from 0 to m-n-1. So for m=8 and n=5 the table is

Move Increment
211 box 1
c=0
box 2
c=1
box 3
c=2
box 4
c=3
r=0 130 76 40 16
r=1 260 152 80 32
r=2 520 304 160 64

Python Code

I've written a python script to generate this and some other related tables. Click here to download it. To generate a set of tables for n=4, m=10 type in the python window

import PyramidTable
PyramidTable.go(4,10,'c:\ptable')

This will generate a file called 'ptable_4_10.html' in the root of the C: drive. Obviously you can create these files elsewhere by changing the third parameter. The first two parameters are the n and m values and are used to generate the file name as well as the tables. The tables are described in the next section.

The structure of the tables

The python script, PyramidTable.py will generate a web page containing 8 tables.

  1. Pyramid Table
  2. Expanded Table
  3. Ranges
  4. Scaled Ranges
  5. Fixed Ranges
  6. Loops
  7. Loop Seeds
  8. Other Loops

There are links to some examples in the previous section. Here we describe the 8 tables generated with reference to (n,m) = (4,10).

Pyramid Table

The equation shows the system that the chosen combination of n and m will define loops for. The value immediately below this is the s-value when all the boxes but the last are empty. The first row shows the number you must add to the cumulative s-value when you move the first bead. The second row shows the number you must add when moving the second bead, and so on. Remember you can only move beads to the same box or one to the right of the box you used in the previous move, so if you moved the first bead to box to, increasing s to 85, the second move must be to box 2 or 3. The object is to use these rules to create a multiple of 943, though we know this is impossible for n values this small.

3x + 943Increment
65box 1box 2box 3
Row 038208
Row 1764016
Row 21528032
Row 330416064
Row 4608320128
Row 51216640256

Expanded Table

This table show the values that can be obtained by following the rules in the Pyramid Table section and stopping in a particular cell. In row 1, box 2 there are two values as there are two sequences that stop in this square, 65+38+40 and 65+20+40. There are 21 sequences that end in row 5, box 3. The number of values in a given box is equal to the number of value above and to the left on the previous row.

3x + 943Values
65box 1box 2box 3
Row 01038573
Row 1179143, 125119, 101, 89
Row 2331259, 223, 205211, 175, 157, 151, 133, 121
Row 3635491, 419, 383, 365395, 323, 287, 269, 275, 239, 221, 215, 197, 185
Row 41243955, 811, 739, 703, 685763, 619, 547, 511, 493, 523, 451, 415, 397, 403, 367, 349, 343, 325, 313
Row 524591883, 1595, 1451, 1379, 1343, 13251499, 1211, 1067, 995, 959, 941, 1019, 875, 803, 767, 749, 779, 707, 671, 653, 659, 623, 605, 599, 581, 569

Ranges

This table shows the range of values that can be found in a given cell in the previous table. For instance row 2, box 3 contains 6 values. The range is 121 to 211, as shown in the table below.

3x + 943Ranges
65box 1box 2box 3
Row 01038573
Row 1179125 - 14389 - 119
Row 2331205 - 259121 - 211
Row 3635365 - 491185 - 395
Row 41243685 - 955313 - 763
Row 524591325 - 1883569 - 1499

Scaled Ranges

The values in the ranges table show the range of values the form loops in 3x+k. We are looking for loops in 3x+1 so we have to divide the values by k (943 in this example). This table shows the resulting ranges.

3x + 943Scaled Range
65box 1box 2box 3
Row 00.1090.0900.077
Row 10.1900.133 - 0.1520.094 - 0.126
Row 20.3510.217 - 0.2750.128 - 0.224
Row 30.6730.387 - 0.5210.196 - 0.419
Row 41.3180.726 - 1.0130.332 - 0.809
Row 52.6081.405 - 1.9970.603 - 1.590

Fixed Ranges

In reality all the values must be odd integers of the form 6n+1 or 6n-1. The "Fixed Ranges" shows the range of integer values that fall within the real ranges calculated above. It also displays the combined range, which in this case is empty.

3x + 943Fixed Range
65box 1box 2box 3
Row 0---------
Row 1---------
Row 2---------
Row 3---------
Row 4---------
Row 5---------

Loops

This table counts the loops generated and lists the smallest value in each. There are twenty 4-cycles in 3x+943 and two 2-cycles.

Loop SizeNumber of LoopsSmallest Elements
2 2 205, 287
4 20 65, 73, 85, 89, 101, 103, 119, 121, 125, 133, 143, 151, 157, 175, 179, 197, 215, 221, 223, 239

Loop Seeds

There are two tables in this section showing where the smallest and largest value in each loop appears in the expanded table. The first number shows the number of loop seeds in a cell as a fraction of the number of values, so 5 loops have their smallest value in row 3, box 3.

1/11/11/1
1/12/23/3
-2/35/6
--5/10
---
---

This second table shows the locations of the maximum values in each loop. Note: there is one more maximum value than minimum values because one of the loops is seeded by the start value, 65.

---
---
---
---
-2/54/15
1/15/610/21

Other Loops

When there is a common factor (f) between the members of a loop and the constant k in 3x+k there will be loops in the system 3x+(K/f) as well. This section shows the loops generated when 'f' is the highest common factor of K and the original loop members. Thus K/f will be the smallest number where this particular loops exists. All odd multiples of K/f will have similar loops. For our choice of m and n we predict one additional 2-cycle in 3x+23 (23 = 943 / 41).

Loop Size Factor System Number of Loops Smallest Elements
2 41 3x + 23 2 5, 7

Other pages

(c) John Whitehouse 2011 - 2023