A064433 Number of iterations of A064455 to reach 2 (or 1 in the case of 1).
1, 1, 2, 6, 3, 5, 7, 12, 4, 14, 6, 11, 8, 8, 13, 13, 5, 10, 15, 15, 7, 7, 12, 12, 9, 17, 9, 71, 14, 14, 14, 68, 6, 19, 11, 11, 16, 16, 16, 24, 8, 70, 8, 21, 13, 13, 13, 67, 10, 18, 18, 18, 10, 10, 72, 72, 15, 23, 15, 23, 15, 15, 69, 69, 7, 20, 20, 20, 12, 12, 12, 66, 17, 74, 17
Offset: 1
Examples
a(4) = 6. Starting with 4, 4 is even so the next number is 4+int(4/2) = 6, 6 is even so next number is 6+int(6/2) = 9, 9 is odd so next number is 9-int(9/2) = 5, 5 is odd so next number is 5-int(5/2) = 3, 3 is odd so next number is 3-int(3/2)=2, so giving a sequence of 4,6,9,5,3,2: 6 numbers. a(5) = 3. Starting with 5, A064455(5) = 3, A064455(3) = 2, so giving a trajectory of 5,3,2: 3 numbers. - _K. Spage_, Aug 07 2014
Links
- Antti Karttunen, Table of n, a(n) for n = 1..19683
- M. del P. Canales Chacon and M. J. Vielhaber, Structural and Computational Complexity of Isometries and Their Shift Commutators, Electr. Colloq. on Computational Cpx., ECCC TR04-057, 2004. [From Michael Vielhaber (vielhaber(AT)gmail.com), Nov 18 2009]
Programs
-
Mathematica
Table[Length@ NestWhileList[If[EvenQ@ #, 3 #/2, (# + 1)/2] &, n, # != 1 + Boole[n > 1] &], {n, 75}] (* Michael De Vlieger, Sep 24 2016 *)
-
PARI
A064455(n) = {if(n%2, (n + 1)/2, 3*n/2)} A064433(n) = {my(c=1); if(n==1, 1, while(n!=2, n=A064455(n); c++); c)} \\ K. Spage, Aug 07 2014
Comments