|
|
A091987
|
|
Number of steps required for initial p = 2^n to reach 0 in the recurrence p = pi(p).
|
|
0
|
|
|
1, 2, 3, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|