

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
(list;
graph;
refs;
listen;
history;
text;
internal format)



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^(k1)(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


LINKS

T. D. Noe, Table of n, a(n) for n = 1..10000


FORMULA

Special values: a(2^k)=1, a(2^k1)=2*3^(k1)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 A167864 A232809
Adjacent sequences: A216848 A216849 A216850 * A216852 A216853 A216854


KEYWORD

nonn


AUTHOR

Benoit Cloitre, Sep 17 2012


STATUS

approved



