login
The modified Syracuse algorithm, msa, applied to 2n+1.
5

%I #64 Jun 28 2026 15:48:14

%S 4,2,7,2,5,2,7,2,4,2,5,2,59,2,56,2,4,2,8,2,5,2,54,2,4,2,5,2,7,2,54,2,

%T 4,2,51,2,5,2,8,2,4,2,5,2,45,2,8,2,4,2,42,2,5,2,31,2,4,2,5,2,8,2,15,2,

%U 4,2,7,2,5,2,7,2,4,2,5,2,40,2,21,2,4,2,29,2,5,2,8,2,4,2,5,2,7,2,13

%N The modified Syracuse algorithm, msa, applied to 2n+1.

%C Normally the '3x+1 problem' or 'Collatz problem' asks for the number of steps to go from n to 1 (A006577). Here we ask for the number of iterations of the mapping, msa, to go from n to less than n; the mapping of x is either -> (3x+1)/2 if x is odd or -> x/2 if x is even.

%C Since the number of iterations of msa for an even number is always 1, we will only investigate the odd numbers greater than one.

%C a(n) = 1 for no values of n;

%C a(n) = 2 for n = 2 + 2k (k=0,1,2,3,...);

%C a(n) = 3 for no values of n;

%C a(n) = 4 for n = 1 + 8k (k=0,1,2,3,...);

%C a(n) = 5 for n = 5 + 16k and 11 + 16k (k=0,1,2,3,...);

%C a(n) = 6 for no values of n;

%C a(n) = 7 for n = 3 + 64k, 7 + 64k, 29 + 64k, etc. (k=0,1,2,3,...).

%C Possible values for a(n) are: 2, 4, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 24, 26, 27, 29, ... (A260593, sorted). Density is ~ 5/8.

%C Record values: 4, 7, 59, 81, 105, 135, 164, 165, 173, 176, 183, 224, 246, 287, 292, 298, 308, 376, 395, 398, 433, 447, 547, ....

%C And the records occur for n: 1, 3, 13, 351, 5043, 17827, 135135, 181171, 190863, 313165, 513715, 563007, 4044031, 6710835, 10319167, 13358335, 28462477, 31864063, 108870007, 600495895, 913698783, 1394004493, ....

%C Remember these n-values are the indices of odd numbers (A005408).

%H Danny Rorabaugh, <a href="/A260590/b260590.txt">Table of n, a(n) for n = 1..10000</a>

%H Encyclopedia of Mathematics, <a href="http://www.encyclopediaofmath.org/index.php/Syracuse_problem">Syracuse problem</a>.

%H Joseph K. Horn, HHC 2014, HP Handheld Conference, Sept. 20-21, 2014, Reno, NV, <a href="https://www.youtube.com/watch?v=d-bdTsaT0tc">Hailstone Numbers: A Pattern Has Been Found</a>.

%H Joseph K. Horn, <a href="http://holyjoe.org/HP71/lexfiles/SYRACUSE%20doc.txt">The Modified Syracuse Algorithm</a>.

%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CollatzProblem.html">The Syracuse Algorithm</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Collatz_conjecture#CITEREFSimons2000">Collatz conjecture</a> (see particularly Section "Cycles").

%F a(n) = the number of iterations for the msa; i.e., the number of mappings of x -> (3x+1)/2 if x is odd or -> x/2 if x is even to arrive at a number less than n.

%F a(n) = the binary length of A260592(n).

%e a(1) is 4 because 2n+1 is 3 and 3 -> 5 -> 8 -> 4 -> 2. The number of iterations of the msa is 4;

%e a(2) is 2 because 2n+1 is 5 and 5 -> 8 -> 4. The number of iterations of the msa is 2;

%e a(3) is 7 because 2n+2 is 7 and 7 -> 11 -> 17 -> 26 -> 13 -> 20 -> 10 -> 5. The number of iterations of the msa is 7; etc.

%e Also see The Modified Syracuse Algorithm link.

%t msa[n_] := If[ OddQ@ n, (3n + 1)/2, n/2]; f[n_] := Block[{k = 2n + 1}, Length@ NestWhileList[ msa@# &, k, # >= k &] - 1]; Array[f, 95]

%Y Cf. A005408, A006577, A020857, A075677, A075884, A076536, A144396, A166245.

%K nonn

%O 1,1

%A Joseph K. Horn and _Robert G. Wilson v_, Jul 29 2015