login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A216851
a(n) = T^(floor(log(n)/log(2)))(n) (see comment).
1
1, 1, 5, 1, 4, 5, 17, 1, 11, 4, 13, 5, 5, 17, 53, 1, 10, 11, 11, 4, 4, 13, 40, 5, 44, 5, 47, 17, 17, 53, 161, 1, 29, 10, 10, 11, 11, 11, 101, 4, 107, 4, 37, 13, 13, 40, 121, 5, 14, 44, 44, 5, 5, 47, 47, 17, 49, 17, 152, 53, 53, 161, 485, 1, 28, 29, 29, 10, 10, 10
OFFSET
1,3
COMMENTS
T is the map T(x) = x/2 (x even) and T(x) = (3x+1)/2 (x odd) and T^(k)(x) = T^(k-1)(T(x)). This sequence has some arithmetical structures and fractal structures. For instance multiples of 3 are not in the sequence.
This is floor(log(n)/log(2)) iterations of the Collatz function applied to n. - T. D. Noe, Sep 25 2012
FORMULA
Special values: a(2^k)=1, a(2^k-1)=2*3^(k-1)-1, a(4^k+1)=3^k+1, a(2*4^k+1)=3^(k+1)+2,...
MATHEMATICA
T[n_] := If[EvenQ[n], n/2, (3 n + 1)/2]; Table[Nest[T, n, Floor[FullSimplify[Log[n]/Log[2]]]], {n, 100}] (* T. D. Noe, Sep 25 2012 *)
PROG
(PARI) T(x)=if(x%2, (3*x+1)/2, x/2);
p(m, n)=if(n<0, 0, t=0; s=n; while(t<m, s=T(s); t++); s);
a(n)=p(floor(log(n)/log(2)), n)
CROSSREFS
Cf. A014682.
Sequence in context: A068468 A200022 A216157 * A179290 A342014 A355953
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Sep 17 2012
STATUS
approved