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”).
%I #15 Oct 12 2015 01:50:12
%S 0,12,62,202,576,1304,2698,4902,8444,14244,22242,34082,50236,70704,
%T 97118,131886,176844,230524,297658,378314,471608,584104,715410,870982,
%U 1057804,1271924,1511090,1781586,2080464,2414944,2819566,3270206
%N a(n) = (sum of first n primes)^2 - sum of squares of first n primes.
%H Harry J. Smith, <a href="/A065595/b065595.txt">Table of n, a(n) for n=1,...,500</a>
%F a(n) = (A007504(n))^2 - A024450(n). - _R. J. Mathar_, Oct 07 2011
%e a(4) = 202 because (2 + 3 + 5 + 7)^2 - (2^2 + 3^2 + 5^2 + 7^2) = 17^2 - (4 + 9 + 25 + 49) = 289 - 87 = 202
%t With[{prs=Prime[Range[40]]},Table[Total[Take[prs,n]]^2-Total[Take[ prs,n]^2], {n,40}]] (* _Harvey P. Dale_, Dec 04 2011 *)
%o (PARI) { a1=a2=0; for (n=1, 500, a1+=prime(n); a2+=prime(n)^2; write("b065595.txt", n, " ", a1^2 - a2) ) } \\ _Harry J. Smith_, Oct 23 2009
%Y Cf. A007504, A024450.
%K easy,nonn
%O 1,2
%A _Terrel Trotter, Jr._, Dec 01 2001
%E a(26)-a(32) from _Harry J. Smith_, Oct 23 2009