login
A109579
Sum([pi(j+1)-pi(j)][prime(j+1)-prime(j)],j=1..n), where pi(k) is the number of prime numbers less than or equal to k and prime(k) is the k-th prime.
1
1, 3, 3, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 23, 23, 29, 29, 29, 29, 33, 33, 33, 33, 33, 33, 35, 35, 49, 49, 49, 49, 49, 49, 55, 55, 55, 55, 61, 61, 71, 71, 71, 71, 83, 83, 83, 83, 83, 83, 85, 85, 85, 85, 85, 85, 91, 91, 93, 93, 93, 93, 93, 93, 107, 107, 107, 107, 111
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
Partial sums of A109578.
Sequence in context: A241274 A088147 A302446 * A109580 A168269 A326936
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 29 2005
STATUS
approved