cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Joseph K. Horn and Robert G. Wilson v, Jul 29 2015

Keywords

Comments

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.
Since the number of iterations of msa for an even number is always 1, we will only investigate the odd numbers greater than one.
a(n) = 1 for no values of n;
a(n) = 2 for n = 2 + 2k (k=0,1,2,3,...);
a(n) = 3 for no values of n;
a(n) = 4 for n = 1 + 8k (k=0,1,2,3,...);
a(n) = 5 for n = 5 + 16k and 11 + 16k (k=0,1,2,3,...);
a(n) = 6 for no values of n;
a(n) = 7 for n = 3 + 64k, 7 + 64k, 29 + 64k, etc. (k=0,1,2,3,...).
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.
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, ....
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, ....
Remember these n-values are the indices of odd numbers (A005408).

Examples

			a(1) is 4 because 2n+1 is 3 and 3 -> 5 -> 8 -> 4 -> 2. The number of iterations of the msa is 4;
a(2) is 2 because 2n+1 is 5 and 5 -> 8 -> 4. The number of iterations of the msa is 2;
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.
Also see The Modified Syracuse Algorithm link.
		

Crossrefs

Programs

  • Mathematica
    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]

Formula

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.
a(n) = the binary length of A260592(n).

A176999 An encoding of the Collatz iteration of n.

Original entry on oeis.org

1, 1111010, 11, 11110, 11110101, 1111011101101010, 111, 1111011101101010110, 111101, 11110111011010, 111101011, 111101110, 11110111011010101, 11110111110101010, 1111, 111101110110, 11110111011010101101, 11110111011010111010, 1111011, 1111110, 111101110110101
Offset: 2

Views

Author

T. D. Noe, Apr 30 2010

Keywords

Comments

Working from right to left, the sequence of 0's and 1's in a(n) encode, respectively, the sequence of 3x+1 and x/2 steps in the Collatz iteration of n. This is reverse one's complement of Garner's parity vector. Criswell mentions this encoding.
The length of a(n) is A006577(n). The number of 1's in a(n) is A006666(n). The number of 0's in a(n) is A006667(n). The number of terms having length k is A005186(k).

Examples

			a(5)=11110 because the Collatz iteration for 5 is a 3x+1 step (0) followed by 4 x/2 steps (four 1's).
		

Crossrefs

Programs

  • Mathematica
    encode[n_]:=Module[{m=n,p,lst={}}, While[m>1, p=Mod[m,2]; AppendTo[lst,1-p]; If[p==0, m=m/2, m=3m+1]]; FromDigits[Reverse[lst]]]; Table[encode[n], {n,2,26}]
Showing 1-2 of 2 results.