cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A065595 a(n) = (sum of first n primes)^2 - sum of squares of first n primes.

Original entry on oeis.org

0, 12, 62, 202, 576, 1304, 2698, 4902, 8444, 14244, 22242, 34082, 50236, 70704, 97118, 131886, 176844, 230524, 297658, 378314, 471608, 584104, 715410, 870982, 1057804, 1271924, 1511090, 1781586, 2080464, 2414944, 2819566, 3270206
Offset: 1

Views

Author

Terrel Trotter, Jr., Dec 01 2001

Keywords

Examples

			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
		

Crossrefs

Programs

  • Mathematica
    With[{prs=Prime[Range[40]]},Table[Total[Take[prs,n]]^2-Total[Take[ prs,n]^2], {n,40}]] (* Harvey P. Dale, Dec 04 2011 *)
  • 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

Formula

a(n) = (A007504(n))^2 - A024450(n). - R. J. Mathar, Oct 07 2011

Extensions

a(26)-a(32) from Harry J. Smith, Oct 23 2009