%I #123 Nov 09 2024 02:28:17
%S 4,-5,20,-29,92,-77,212,-149,380,-461,500,-869,812,-1037,1172,-1637,
%T 1844,-1877,2612,-2429,2900,-3341,3548,-4373,5036,-5165,5444,-6005,
%U 5876,-6893,9236,-7925,10844,-8477,13724,-9077,15572,-10997,16892,-13037,19004,-13757
%N 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.
%C 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.
%H Seiichi Manyama, <a href="/A240860/b240860.txt">Table of n, a(n) for n = 1..10000</a>
%H Timothy Varghese, <a href="http://mathoverflow.net/questions/164936/is-the-alternating-sum-of-primes-2-3-5-p-n-asymptotic-to-n-ln-n-2">Alternating sums</a>, MathOverflow, May 2014.
%o (PARI) a(n) = sum(i=1, n, (-1)^(i+1)*prime(i)^2); \\ _Michel Marcus_, May 09 2014
%Y Cf. A000040, A008347, A024450.
%K sign
%O 1,1
%A _Timothy Varghese_, May 06 2014