%I #14 Feb 23 2018 18:20:23
%S -1,1,3,2,5,12,10,13,13,20,33,44,59,78,78,75,85,108,129,145,152,164,
%T 173,200,227,242,258,293,332,371,385,398,439,486,527,578,627,678,733,
%U 788,821,843,898,963,1028,1097,1120,1146,1217,1292,1367,1442,1487,1513,1592
%N n-th perfect power - n-th prime: pp(n) - prime(n).
%C Besides first 1, all other terms are positive. At n>16, the function pp(n)-p(n) is (apparently) monotonically increasing.
%F a(n) = A001597(n) - A000040(n).
%e pp(3)-p(3)= 8-5=3.
%t Module[{upto=2000,pp,pr,len},pp=Flatten[Table[Range[Surd[upto,n]]^n,{n,2,Sqrt[ upto]}]]//Union;pr=Prime[Range[PrimePi[upto]]];len=Min[ Length[ pp],Length[pr]];#[[1]]-#[[2]]&/@Thread[ {Take[pp,len], Take[ pr,len]}]] (* _Harvey P. Dale_, Feb 23 2018 *)
%o (PARI) lista(nn) = {vec = vector(nn, i, i); pp = select(i->((ispower(i) || (i==1))), vec); for (i = 1, #pp, print1(pp[i] - prime(i), ", "););} \\ _Michel Marcus_, Oct 02 2013
%Y Cf. A001597.
%K easy,sign
%O 1,3
%A _Zak Seidov_, Oct 11 2002
|