OFFSET
1,3
COMMENTS
Similar to 3x+1 series (A008908). Does this sequence converge to 2 for all values of n (true for all values of n up to 100000)? The inverse sequence using next n = n-int(n/2) for n even and n+int(n/2) for n odd leads to 3 (?) possible end sequences (1), (5, 7, 10) and (17, 25, 37, 55, 82, 41, 61, 91, 136, 68, 34)
Starting with a number n, the next value generated is n+int(n/2) if n is even, n-int(n/2) if n is odd; a(n) is the number of iteration for the initial value n to reach the limit of 1 to 2
Collatz's 3N+1 function as isometry over the dyadics is N->N/2 if even, but N->(3N+1)/2 if odd, including the (necessary) halving into each tripling step. Counting steps until reaching 1 in this way leads to this sequence instead of A008908. - Michael Vielhaber (vielhaber(AT)gmail.com), Nov 18 2009
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]
EXAMPLE
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.
MATHEMATICA
Table[Length@ NestWhileList[If[EvenQ@ #, 3 #/2, (# + 1)/2] &, n, # != 1 + Boole[n > 1] &], {n, 75}] (* Michael De Vlieger, Sep 24 2016 *)
PROG
CROSSREFS
KEYWORD
AUTHOR
Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Oct 01 2001
STATUS
approved