OFFSET
1,1
MAPLE
with(numtheory): a:=proc(n) if isprime(sum((pi(k+1)-pi(k))*(ithprime(k+1)-ithprime(k)), k=1..n))=true then sum((pi(k+1)-pi(k))*(ithprime(k+1)-ithprime(k)), k=1..n) else fi end: seq(a(n), n=1..230);
MATHEMATICA
an = Table[(PrimePi[n + 1] - PrimePi[n])*(Prime[n + 1] - Prime[n]), {n, 1, 400}] a[0] = 0; a[n_] := a[n] = a[n - 1] + an[[n]] aa = Flatten[Table[If[PrimeQ[a[n]] == True, a[n], {}], {n, 0, Length[an]}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 29 2005
STATUS
approved