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.
PROG
(PARI) a(n, s=0)={forprime(p=n^2, (n+1)^2, s+=p-n^2); s}
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Oct 19 2018
STATUS
approved