%I #12 Apr 03 2023 10:36:10
%S 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,
%T 13,13,13,13,14,14,14,14,14,15,15,15,15,15,16,16,16,16,16,17,17,17,17,
%U 17,18,18,18,18,18,19,19,19,19,19,20,20,20
%N Number of steps required for initial p = 2^n to reach 0 in the recurrence p = pi(p).
%H Andrew Booker, <a href="https://t5k.org/nthprime/index.php#piofx">The Nth Prime Page</a>.
%F 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.
%e Pi(32) = 11
%e Pi(11) = 5
%e Pi(5) = 3
%e Pi(3) = 2
%e Pi(2) = 1
%e Pi(1) = 0
%e Total steps to reach 0 = 6. Thus 6 is the 6th entry in the sequence corresponding to n=5.
%t Table[Length[NestWhileList[PrimePi,2^n,#>0&]]-1,{n,0,40}] (* _Harvey P. Dale_, May 29 2016 *)
%o (PARI) pr2n(n) = my(c); for(x=0,n, y=2^x; c=0; p=y; while(p,p = primepi(p);c++); print1(c","))
%Y Cf. A000720.
%K hard,nonn
%O 0,2
%A _Cino Hilliard_, Mar 16 2004
%E More terms from _Harvey P. Dale_, May 29 2016
%E a(41)-a(64) from _Chai Wah Wu_, May 25 2018