OFFSET
0,2
COMMENTS
FORMULA
a(n) = 2^n for odd n.
EXAMPLE
The iteration for 21 is {21, 64, 32, 16, 8, 4, 2, 1}, which shows that 64 = 2^6 is a term. However, 32 is not the first power of two. We have to wait until the iteration for 32, which is {32, 16, 8, 4, 2, 1}, to see 32 = 2^5 as the first power of two.
MATHEMATICA
Collatz[n_?OddQ] := 3*n + 1; Collatz[n_?EvenQ] := n/2; nn = 21; t = Table[-1, {nn}]; n = 0; cnt = 0; While[cnt < nn, n++; q = Log[2, NestWhile[Collatz, n, Not[IntegerQ[Log[2, #]]] &]]; If[q < nn && t[[q + 1]] == -1, t[[q + 1]] = n; cnt++]]; t
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Dec 02 2013
STATUS
approved