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”).

A211667
Number of iterations sqrt(sqrt(sqrt(...(n)...))) such that the result is < 2.
3
0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
OFFSET
1,4
COMMENTS
Different from A001069, but equal for n < 256.
LINKS
FORMULA
a(2^(2^n)) = a(2^(2^(n-1))) + 1, for n >= 1.
G.f.: g(x) = 1/(1-x)*Sum_{k>=0} x^(2^(2^k))
= (x^2 + x^4 + x^16 + x^256 + x^65536 + ...)/(1 - x).
a(n) = 1 + floor(log_2(log_2(n))) for n>=2. - Kevin Ryde, Jan 18 2024
EXAMPLE
a(n) = 1, 2, 3, 4, 5, ... for n = 2^1, 2^2, 2^4, 2^8, 2^16, ..., i.e., n = 2, 4, 16, 256, 65536, ... = A001146.
MATHEMATICA
a[n_] := Length[NestWhileList[Sqrt, n, # >= 2 &]] - 1; Array[a, 100] (* Amiram Eldar, Dec 08 2018 *)
PROG
(PARI) apply( A211667(n, c=0)={while(n>=2, n=sqrtint(n); c++); c}, [1..50]) \\ This defines the function A211667. The apply(...) provides a check and illustration. - M. F. Hasler, Dec 07 2018
(PARI) a(n) = if(n<=1, 0, logint(logint(n, 2), 2) + 1); \\ Kevin Ryde, Jan 18 2024
(Python) A211667=lambda n: n and (n.bit_length()-1).bit_length() # Nathan L. Skirrow, May 16 2023
CROSSREFS
Cf. A087046 (run lengths).
Sequence in context: A151659 A057467 A074594 * A001069 A156877 A110591
KEYWORD
nonn,easy
AUTHOR
Hieronymus Fischer, Apr 30 2012
STATUS
approved