%I #19 May 16 2020 12:04:05
%S 2,3,4,5,6,7,7,8,8,8,9,9,9,10,10,10,11,11,11,11,12,12,12,12,13,13,13,
%T 13,14,14,14,14,15,15,15,15,15,16,16,16,16,16,17,17,17,17,17,18,18,18,
%U 18,18,19,19,19,19,19,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22
%N Start at 2^n, iterate function PrimePi (A000720) until fixed point is reached; sequence gives number of steps.
%C A007097(a(n) - 2) <= 2^n < A007097(a(n) - 1). - _David Wasserman_, May 31 2002
%H S. Segal, <a href="http://dx.doi.org/10.1090/S0002-9947-1962-0139586-4">On pi(x+y)<=pi(x)+pi(y)</a>, Transactions American Mathematical Society, 104 (1962), 523-527.
%e n=24, the relevant list is: {16777216,1077871,84115,8198,1028,172,39,12,5,3,2,1,0}, its length a(24)=13.
%t Table[Length[FixedPointList[PrimePi, 2^w]]-1, {w, 0, 32}]
%t f[n_] := Length@ NestWhileList[ PrimePi, 2^n, # > 0 &]; Array[f, 48, 0] (* _Robert G. Wilson v_, Aug 12 2011 *)
%o (PARI) a(n) = {my(c=2, k=2^n); while(k=primepi(k), c++); c; } \\ _Jinyuan Wang_, May 16 2020
%Y Cf. A060208, A007097, A000720, A033844, A071682.
%K nonn
%O 0,1
%A _Labos Elemer_, Mar 19 2001
%E More terms from _David Wasserman_, May 31 2002
|