OFFSET
1,1
COMMENTS
For n even this is the negative of the sum of (3^2 - 2^2) + (7^2 - 5^2) + .. (prime(n)^2 - prime(n-1)^2. But this is half of the terms in the sum of (3^2 - 2^2) + (5^2 - 3^2) + (7^2 - 5^2) + ... +(prime(n)^2 - prime(n-1)^2 which has a sum that telescopes to prime(n)^2 - 4. Thus a good estimate of a(n) (half the terms) is prime(n)^2/2 (half the square of the n-th prime) which works well up to n = 10000. For odd n, add prime(n)^2 to the estimate for even n.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
Timothy Varghese, Alternating sums, MathOverflow, May 2014.
PROG
(PARI) a(n) = sum(i=1, n, (-1)^(i+1)*prime(i)^2); \\ Michel Marcus, May 09 2014
CROSSREFS
KEYWORD
sign
AUTHOR
Timothy Varghese, May 06 2014
STATUS
approved