OFFSET
1,2
FORMULA
EXAMPLE
n=1: c[1]=4, sigma[4]=1+2+4=7 prime, a(1)=0; n=10: c[10]=18, sigma[18]=1+2+3+6+9+18=39 composite and 39 is the 26th composite number, so a(10)=26.
MATHEMATICA
c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] G[x_] := x-PrimePi[x]-1 Do[s=c[n]; s1=DivisorSigma[1, s]; s2=G[s1]; If[PrimeQ[s1], Print[0]]; If[ !PrimeQ[s1], Print[s2]], {n, 1, 128}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Aug 06 2002
STATUS
approved