In this section

Introduction

Earlier when calculating where we needed to start looking for loops, given that exhaustive searches had eliminated most numbers up to 1015 we decided to look for systems where the maximum ratio of a seed value to K was greater than this value. Unfortunately loops with large values also contain small values, and all the values must be greater than our cut-off value. So what we need to do is find, for a particular combination of m and n, what the largest loop seed (the smallest loop member) is. For small n and m values we can just search through the loop members; the results are summarised in the following tables (LS is the largest loop seed).

n m LS K LS/K
3 5 23 5  
3 6 37 37 1
3 7 37 101  
3 8 53 229  
3 9 97 485 1/5
3 10 97 997  
3 11 161 2021  
3 12 313 4069 1/13
3 13 313 8165  
n m LS K LS/K
6 10 1357 295  
6 11 1805 1319  
6 12 3367 3367 1
6 13 3367 7463  
n m LS K LS/K
4 7 101 47  
4 8 175 175 1
4 9 175 431  
4 10 287 943  
4 11 415 1967  
4 12 803 4015 1/5
4 13 803 8111  
n m LS K LS/K
7 12 5095 1909  
7 13 7463 6005  
7 14 14197 14197 1
7 15 14197 30581  
n m LS K LS/K
5 8 319 13  
5 9 431 269  
5 10 781 781 1
5 11 781 1805  
5 12 1299 3853  
5 13 1885 7949  
5 14 3293 16141  
5 15 6505 32525 1/5
5 16 6505 65293  
n m LS K LS/K
8 13 14501 1631  
8 14 21109 9823  
8 15 30581 26207  
8 16 58975 58975 1
8 17 58975 124511  

Observations

There are a few interesting observations in the above table.

  • When m=2*n the largest value is always equal to K, which generates the [1,4,2,1] cycle.
  • The largest seed for m=2n+1 is the same as for m = 2n.
  • The value for m=3*n is always K/5.
  • The value for m=3n+1 is the same as for m=3n.
  • The LS values grow more slowly than the K values with increasing n.

The values LS/K=1 when m=2n is obtained by setting all the 'a' values to 2. The 1/5 is when all the 'a' values are 3. The sequence continues [1, 1/5, 1/13, 1/29, 1/61, 1/125.0, 1/253, 1/509, ...], the rule being double it and add 3.

Here we have proved that there are no cycles (other than [1,4,2,1]) in 3x+1 that contain twice as many or more even numbers as odd numbers, so there is no point looking at systems where m>=2n. When a list consists of a repeated sequence it can be factorised, so [2,2,2] is [2]^3, which generates three repeats of the basic cycle [1,4,2,1]. This is the cycle with the largest possible ratio m/n.

Which 'a' Values?

For a given n value the loop values are determined by the equation.

s = (3n-1 + 3n-2*2a1 + 3n-3*2a1+a2 + ...)

What combinations of 'a' values lead to the loop seeds encountered above? Here are a few lists found by searching through the sets of all a values that meet the constraint sum(a)=m. The set of lists gets very large so I've stopped at m = 10.

n m LS loop
3 5 23 [1, 2, 2]
3 6 37 [2, 2, 2]
4 7 101 [1, 2, 2, 2]
4 8 175 [2, 2, 2, 2]
5 8 319 [1, 2, 1, 2, 2]
6 10 1357 [1, 2, 2, 1, 2, 2]

It appears likely that for a given n and m the highest loop seed will be found by mixing the '1' and '2' values as uniformly as possible across the list. This can be achieved by using Bresenham's line algorith to connect the points (0,0) to (m,n). Applying this algorithm is a lot quicker than searching all the possible lists so we can easily try it for larger numbers. Here are some results (LS¬[obs] is the value obtained by testing all the loops, LS¬[post] is calculated from the postulated minimal loop)

n m Minimal loop LSobs LSpost
3 5 [1, 2, 2] 23 23
4 7 [1, 2, 2, 2] 101 101
5 8 [1, 2, 1, 2, 2] 319 319
6 10 [1, 2, 2, 1, 2, 2] 1357 1357
7 12 [1, 2, 2, 1, 2, 2, 2] 5095 5095
8 13 [1, 2, 1, 2, 2, 1, 2, 2] 14501 14501

So this method correctly predicts the largest loop seed for n values up to 8. Let's see what it predicts for some larger numbers.

n m Minimal loop LSpost
915[1, 2, 2, 1, 2, 2, 1, 2, 2]60,191
1016[1, 2, 1, 2, 2, 1, 2, 1, 2, 2]159,181
1118[1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2]579,943
1220[1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2]2,378,821
1321[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]5,805,215
1423[1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2]21,687,773
1524[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]59,586,967
1626[1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]213,933,253
1727[1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]548,440,271
1829[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]1,994,724,077
1931[1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2]7,319,701,703
2032[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]19,831,564,885
2134[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]68,498,816,767
2235[1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]176,086,441,085
2337[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]634,236,499,703
2439[1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]2,376,761,709,797
2540[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]6,189,164,834,479
2642[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]21,429,806,042,125
2743[1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]53,749,761,723,047
2845[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2]192,396,217,969,781
2946[1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]490,121,922,519,007
3048[1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2]1,854,711,264,038,941

These values haven't been verified using exhaustive searches.

Where to look for loops

Looking at the loop seeds (the smallest number in a loop) gives us a much tighter constraint. If we take the set of loop seeds for a particular 'n' and find the largest, we can see that these are much smaller than the largest loop members. The following table shows how the two sets of numbers compare (the ratios have been truncated to whole numbers).

nmLargest seedMax loop memberRatio
12111
247111
3523492
471013313
583191,1213
6101,3576,9955
7125,09543,2898
81314,501133,9639
91560,191813,60113
1016159,1812,473,57115
1118579,94314,913,44925
12202,378,82189,827,83537
13215,805,215270,532,08146
142321,687,7731,625,792,46774
152459,586,9674,885,766,00981
1626213,933,25329,333,801,579137
1727548,440,27188,068,513,601160
18291,994,724,077528,550,376,899265
19317,319,701,7033,171,988,582,729433
203219,831,564,8859,518,113,231,835479
213468,498,816,76757,113,782,541,201833
2235176,086,441,085171,358,527,492,787973
2337634,236,499,7031,028,188,503,373,8491,621
24392,376,761,709,7976,169,311,754,971,2112,596
25406,189,164,834,47918,508,485,020,727,5212,990
264221,429,806,042,125111,052,261,859,011,2355,182
274353,749,761,723,047333,161,183,623,544,8096,198
2845192,396,217,969,7811,998,977,068,329,828,28310,390
2946490,121,922,519,0075,996,966,389,361,573,68112,236
30481,854,711,264,038,94135,981,870,443,280,432,53119,400

So by the time we get to 30 we are already 4 orders of magnitude down on the limit calculated using the largest value. The chart shows that this ratio increases by about an order of magnitude for every seven n values.

For n = 82 we'd expect the ratio to be about 1012, so the largest value we'd need to test searching for loops would be around 1000. The next table shows how the ratio LS/K varies with 'n' (using the predicted LS values).

nmLSKLS/K
12111
24771
352354
47101472
583191324
6101,3572954
7125,0951,9092
81314,5011,6318
91560,19113,0854
1016159,1816,48724
1118579,94384,9976
12202,378,821517,1354
13215,805,215502,82911
142321,687,7733,605,6396
152459,586,9672,428,30924
1626213,933,25324,062,1438
1727548,440,2715,077,565108
18291,994,724,077149,450,42313
19317,319,701,703985,222,1817
203219,831,564,885808,182,89524
213468,498,816,7676,719,515,98110
2235176,086,441,0852,978,678,75959
2337634,236,499,70343,295,774,64514
24392,376,761,709,797267,326,277,4078
25406,189,164,834,479252,223,018,33324
264221,429,806,042,1251,856,180,682,77511
274353,749,761,723,0471,170,495,537,22145
2845192,396,217,969,78112,307,579,633,87115
2946490,121,922,519,0071,738,366,812,781281
30481,854,711,264,038,94175,583,844,616,00724

Searching up to 281 will eliminate all possibility of loops with fewer than 79 members. The next table shows some values from the region 80-90 (I've missed out the actual LS and K values as they are rather large). Note the ratios are still pretty small, and that the largest value we'd have to test to eliminate loops with fewer than 234 members would be 867.

nmLS/K Predicted
811294546
82130867877
831326465
841343334
85135108108
861374344
87138281284
881405959
891423234
901438890

The "predicted" values are calculated using the equation

LS/K = n * √8 / (m - n * log(3)/log(2))

which is derived empirically from the next chart. The product of LS/K and (m−n * log(3)/log(2)) is nearly linear:

The gradient is about 0.35, which roughly 1/√8, the constant I used to predict the LS/K values in the earlier table.

(m - n * log(3)/log(2)) varies irregularly in the range 0 - 1. LS/K values will be at their largest when it is close to 0.

The next chart shows the values of LS/K (predicted) out to n=1500. Note the bulk of the values are close to the 0.35n line which forms the lower bound. However, some of the outriders are significantly higher, here by up to a factor of 1000.

Notable values are summarised in the next table, which covers n up to 100,000,000.

n m m-n*log(3)/log(2) n/√8 LS/K (pred) LS/K (calc)
350.2451121.0644
580.0751871.772324
17270.0556376.01108108
29460.03608710.25284281
41650.01653714.50876867
941490.01352533.232,4572,419
1472330.01051251.974,9434,862
2003170.00750070.719,4289,266
2534010.00448789.4519,93319,584
3064850.001475108.1973,35872,058
9711,5390.001412343.30243,165238,670
1,6362,5930.001349578.41428,829420,841
2,3013,6470.001286813.53632,680620,858
2,9664,7010.0012231048.64857,529841,477
3,6315,7550.0011601283.751,106,7961,086,054
4,2966,8090.0010971518.871,384,686 
4,9617,8630.0010341753.981,696,431 
5,6268,9170.0009711989.092,048,618 
6,2919,9710.0009082224.202,449,663 
6,95611,0250.0008452459.322,910,491 
7,62112,0790.0007822694.433,445,545 
8,28613,1330.0007192929.544,074,330 
8,95114,1870.0006563164.664,823,840 
9,61615,2410.0005933399.775,732,537 
10,28116,2950.0005303634.886,857,158 
10,94617,3490.0004673870.008,285,043 
11,61118,4030.0004044105.1110,157,974 
12,27619,4570.0003414340.2212,722,434 
12,94120,5110.0002784575.3316,448,126 
13,60621,5650.0002154810.4522,354,632 
14,27122,6190.0001525045.5633,149,032 
14,93623,6730.00008925280.6759,181,261 
15,60124,7270.00002625515.79210,131,286 
47,46875,2350.000015816782.471,064,327,305 
79,335125,7430.0000052928049.165,305,246,769 
190,537301,9940.000000093067365.00724,231,494,698 
10,781,27417,087,9150.00000001493811755.98255,802,613,502,959 
75,278,381119,313,4110.000000014926614926.841,786,097,505,737,402 

The linear relationship appears to hold for at least n values up to 3600, but using 1/√8 as the constant of proportionality appears to overestimate the values by about 2%. 0.36 would be closer. This doesn't really effect the result though. To find loops given that the smallest value must be greater than 1015 we need to search loops with at least 194 million members.

I stopped calculating LS/K at n = 3631 as the K value has 1730 digits.

Other pages

(c) John Whitehouse 2011 - 2023