OFFSET
1,2
COMMENTS
From Hieronymus Fischer, Apr 08 2012: (Start)
A possibly simpler definition could be: "Number of iterations log_2(log_2(log_2(...(n)...))) such that the result is < 1".
Changing "< 1" to "<= 1" produces version 3, A230864.
FORMULA
From Hieronymus Fischer, Apr 08 2012: (Start)
a(n) = A001069(n) + 1.
With the exponentiation definition E_{i=1..n} c(i) := c(1)^(c(2)^(c(3)^(...(c(n-1)^(c(n))))...))); E_{i=1..0} := 1; example: E_{i=1..4} 2 = 2^(2^(2^2)) = 2^16, we get:
a(E_{i=1..n} 2) = a(E_{i=1..n-1} 2) +1, for n >= 1.
G.f.: g(x) = 1/(1-x)*Sum_{k>=0} x^(E_{i=1..k} 2).
The explicit first terms of this g.f. are
g(x) = (x + x^2 + x^4 + x^16 + x^65536 + ...)/(1-x). (End)
EXAMPLE
Becomes 5 at 65536, 6 at 2^65536, etc.
MATHEMATICA
f[n_] := Length@ NestWhileList[ Log[2, #] &, n, # >= 1 &] - 1; Array[f, 105] (* Robert G. Wilson v, Apr 19 2012 *)
PROG
(Haskell)
a010096 = length . takeWhile (/= 0) . iterate a000523
-- Reinhard Zumkeller, Mar 16 2012
(PARI) a(n)=if(n<1, 0, 1+a(log(n)\log(2))) \\ Charles R Greathouse IV, Apr 17 2012
(PARI) a(n)=if(n<1, 0, 1+a(logint(n, 2))) \\ Charles R Greathouse IV, Oct 23 2015
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Edited by Hieronymus Fischer, Apr 08 2012
Edited by N. J. A. Sloane, Nov 03 2013
STATUS
approved