A082519 Number of times that k^2 + (n-k)^2 is prime for 1 <= k <= n-1.
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
Keywords
Examples
a(5) = 4 because 1+16, 4+9, 9+4 and 16+1 are primes.
Links
- Antti Karttunen, Table of n, a(n) for n = 2..16384
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
Extensions
Edited and extended by T. D. Noe, Oct 15 2004