OFFSET
1,3
COMMENTS
Essentially A036468 restricted to the primes.
a(n) <= floor(prime(n)/2).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
prime(5) = 11 can be represented as 10+1, 9+2, 8+3, 7+4 and 6+5. Among 10^2+1^2 = 101, 9^2+2^2 = 85, 8^2+3^2 = 73, 7^2+4^2 = 65 and 6^2+5^2 = 61 are three primes, hence a(5) = 3.
MAPLE
f:= proc(n) local a;
add(charfcn[{true}](isprime(a^2 + (n-a)^2)), a=1..n/2)
end proc:
map(f, [seq(ithprime(i), i=1..100)]); # Robert Israel, Jun 03 2019
MATHEMATICA
Reap[Do[p = Prime[n]; c = 0; Do[b = p - a; If[PrimeQ[a^2 + b^2], c++], {a, 1, p/2}]; Sow[c], {n, 1, 75}]][[2, 1]] (* Jean-François Alcover, Aug 19 2020 *)
PROG
(PARI) {for(n=1, 75, p=prime(n); c=0; for(a=1, p\2, b=p-a; if(isprime(a^2+b^2), c++)); print1(c, ", "))} /* Klaus Brockhaus, Mar 26 2007 */
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Mar 24 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Mar 26 2007
STATUS
approved