|
|
A240860
|
|
a(n) = Sum_{i=1..n} (-1)^{i+1} prime(i)^2, where prime(k) denotes the k-th prime: alternating sum of the squares of the first n primes.
|
|
3
|
|
|
4, -5, 20, -29, 92, -77, 212, -149, 380, -461, 500, -869, 812, -1037, 1172, -1637, 1844, -1877, 2612, -2429, 2900, -3341, 3548, -4373, 5036, -5165, 5444, -6005, 5876, -6893, 9236, -7925, 10844, -8477, 13724, -9077, 15572, -10997, 16892, -13037, 19004, -13757
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
PROG
|
(PARI) a(n) = sum(i=1, n, (-1)^(i+1)*prime(i)^2); \\ Michel Marcus, May 09 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|