OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
J. Wu, Primes of the form 1 + m^2 + n^2 in short intervals, Proc. Amer. Math. Soc. 126 (1998), 1-8.
EXAMPLE
First such decompositions are 3 = 1 + 1^2 + 1^2, 11 = 1 + 1^2 + 3^2, 59 = 1 + 3^2 + 7^2.
First instance of several decompositions for the same prime: 131 = 1 + 3^2 + 11^2 = 1 + 7^2 + 9^2.
MAPLE
filter:= proc(n) local S, x, y;
if not isprime(n) then return false fi;
S:= map(t -> subs(t, [x, y]), [isolve](x^2 + y^2 = n-1));
ormap(t -> t[1] > 0 and t[2] >= t[1] and igcd(t[1], t[2])=1, S)
end proc:
select(filter, [seq(i, i=3..5000, 2)]); # Robert Israel, Sep 30 2024
PROG
(PARI) hasform(p) = {q = p - 1; for (k = 1, q/2, if (issquare(k) && issquare(q-k) && (gcd(k, q-k)==1), return(1)); ); return(0); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Dec 22 2012
STATUS
approved