OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
29=5^2+2^2 is in the sequence because 29+2=31 is prime.
MAPLE
f:= proc(p) local F;
if not isprime(p) then return false fi;
F:= GaussInt:-GIfactors(p)[2][1][1];
isprime(p+abs(Re(F))) or isprime(p+abs(Im(F)))
end proc:
select(f, [2, seq(i, i=5..10000, 4)]); # Robert Israel, Apr 14 2020
MATHEMATICA
puvQ[{u_, v_}]:=Module[{p=u^2+v^2}, PrimeQ[p]&&AnyTrue[p+{u, v}, PrimeQ]]; Take[Union[ #[[1]]^2+#[[2]]^2&/@Select[Subsets[Range[-1, 100], {2}], puvQ]], 60] (* Harvey P. Dale, Sep 02 2023 *)
PROG
(PARI) list(lim)=my(L=List([2]), u2, p); for(u=2, sqrtint(lim\=1), u2=u^2; forstep(v=if(u%2, 2, 1), min(sqrtint(lim-u2), u-1), 2, if(isprime(p=u2+v^2) && (isprime(p+u) || isprime(p+v)), listput(L, p)))); Set(L) \\ Charles R Greathouse IV, Apr 14 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Thomas Ordowski, Jun 30 2012
EXTENSIONS
Terms >=61 by R. J. Mathar, Jun 30 2012
STATUS
approved