OFFSET
1,2
EXAMPLE
a(2)=3 because pi(1)=0,p(2)=1,p(3)=2,prime(1)=2,prime(2)=3,prime(3)=5 and so a(2)=(1-0)(3-2)+(2-1)(5-3)=1+2=3.
MAPLE
with(numtheory): a:=n->sum((pi(k+1)-pi(k))*(ithprime(k+1)-ithprime(k)), k=1..n): seq(a(n), n=1..70);
MATHEMATICA
an = Table[(PrimePi[n + 1] - PrimePi[n])*(Prime[n + 1] - Prime[n]), {n, 1, 200}] a[0] = 0; a[n_] := a[n] = a[n - 1] + an[[n]] aa = Table[a[n], {n, 0, Length[an]}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 29 2005
STATUS
approved