login
A082519
Number of times that k^2 + (n-k)^2 is prime for 1 <= k <= n-1.
3
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,2
LINKS
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
EXAMPLE
a(5) = 4 because 1+16, 4+9, 9+4 and 16+1 are primes.
MATHEMATICA
Table[cnt=0; Do[If[PrimeQ[k^2+(n-k)^2], cnt++ ], {k, 1, n-1}]; cnt, {n, 2, 150}]
PROG
(PARI) A082519(n) = sum(k=1, n-1, isprime((k^2)+((n-k)^2))); \\ Antti Karttunen, Jan 22 2020
CROSSREFS
Cf. A036468 (number of ways to represent 2n+1 as a+b with a^2+b^2 prime).
Sequence in context: A109578 A302826 A332903 * A035688 A364105 A046769
KEYWORD
nonn
AUTHOR
CHAUVIN thierry (thierry.chaun2(AT)wanadoo.fr), Apr 30 2003
EXTENSIONS
Edited and extended by T. D. Noe, Oct 15 2004
STATUS
approved