OFFSET
0,2
LINKS
Andrew Booker, The Nth Prime Page.
FORMULA
pi(n) = A000720(n) = number of primes less than or equal to n. By repeating n=pi(n), n will reach 0 in a finite number of steps.
EXAMPLE
Pi(32) = 11
Pi(11) = 5
Pi(5) = 3
Pi(3) = 2
Pi(2) = 1
Pi(1) = 0
Total steps to reach 0 = 6. Thus 6 is the 6th entry in the sequence corresponding to n=5.
MATHEMATICA
Table[Length[NestWhileList[PrimePi, 2^n, #>0&]]-1, {n, 0, 40}] (* Harvey P. Dale, May 29 2016 *)
PROG
(PARI) pr2n(n) = my(c); for(x=0, n, y=2^x; c=0; p=y; while(p, p = primepi(p); c++); print1(c", "))
CROSSREFS
KEYWORD
hard,nonn
AUTHOR
Cino Hilliard, Mar 16 2004
EXTENSIONS
More terms from Harvey P. Dale, May 29 2016
a(41)-a(64) from Chai Wah Wu, May 25 2018
STATUS
approved