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.

A082519 Number of times that k^2 + (n-k)^2 is prime for 1 <= k <= n-1.

Original entry on oeis.org

1, 2, 0, 4, 0, 4, 0, 4, 0, 6, 0, 6, 0, 8, 0, 8, 0, 8, 0, 6, 0, 8, 0, 16, 0, 8, 0, 12, 0, 10, 0, 8, 0, 18, 0, 16, 0, 12, 0, 18, 0, 14, 0, 14, 0, 14, 0, 10, 0, 14, 0, 18, 0, 28, 0, 16, 0, 18, 0, 22, 0, 14, 0, 34, 0, 22, 0, 20, 0, 18, 0, 22, 0, 18, 0, 16, 0, 26, 0, 18, 0, 30, 0, 40, 0, 22, 0, 28, 0
Offset: 2

Views

Author

CHAUVIN thierry (thierry.chaun2(AT)wanadoo.fr), Apr 30 2003

Keywords

Examples

			a(5) = 4 because 1+16, 4+9, 9+4 and 16+1 are primes.
		

Crossrefs

Cf. A036468 (number of ways to represent 2n+1 as a+b with a^2+b^2 prime).

Programs

  • Mathematica
    Table[cnt=0; Do[If[PrimeQ[k^2+(n-k)^2], cnt++ ], {k, 1, n-1}]; cnt, {n, 2, 150}]
  • PARI
    A082519(n) = sum(k=1,n-1,isprime((k^2)+((n-k)^2))); \\ Antti Karttunen, Jan 22 2020

Formula

a(2) = 1, a(2n) = 0 for n>1 and a(2n+1) = 2*A036468(n) for n>0 - T. D. Noe, Oct 15 2004

Extensions

Edited and extended by T. D. Noe, Oct 15 2004