login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A320688
Sum of the square excess A056892 of the primes between two squares.
2
3, 4, 6, 11, 10, 24, 26, 34, 26, 33, 50, 67, 72, 46, 70, 109, 96, 132, 122, 153, 132, 145, 174, 229, 208, 175, 194, 287, 232, 244, 338, 267, 276, 345, 374, 239, 392, 396, 424, 390, 484, 373, 514, 563, 618, 424, 654, 821, 442, 557, 890, 814, 668, 741, 580, 642, 990, 811, 982, 968, 772
OFFSET
1,1
COMMENTS
Consider the primes p1,...,pK between two squares n^2 and (n+1)^2, and take the sum of the differences: (p1 - n^2) + ... + (pK - n^2). Obviously this equals (sum of these primes) - (number of these primes) * n^2.
LINKS
FORMULA
a(n) = A108314(n) - A014085(n)*A000290(n), where A000290(n) = n^2.
MAPLE
R:= NULL: p:= 2: n:= 1: t:= 0:
while n <= 100 do
t:= t + p-n^2;
p:= nextprime(p);
if p > (n+1)^2 then
R:= R, t; t:= 0; n:= n+1;
fi:
od:
R; # Robert Israel, Dec 17 2024
PROG
(PARI) a(n, s=0)={forprime(p=n^2, (n+1)^2, s+=p-n^2); s}
CROSSREFS
Row sums of A056892, read as a table.
Sequence in context: A091424 A092839 A185874 * A352734 A275418 A047413
KEYWORD
nonn
AUTHOR
M. F. Hasler, Oct 19 2018
STATUS
approved