OFFSET
1,2
COMMENTS
Detailed description in A103431.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Sven Simon, List with Gaussian primes of A103431/A103432
MAPLE
N:= 100: # to get all terms with norm <= N
p1:= select(isprime, [seq(i, i=3..N, 4)]):
p2:= select(isprime, [seq(i, i=1..N^2, 4)]):
p2:= map(t -> GaussInt:-GIfactors(t)[2][1][1], p2):
p3:= sort( [1+I, op(p1), op(p2)], (a, b) -> Re(a)^2 + Im(a)^2 < Re(b)^2 + Im(b)^2):
h:= proc(z)
local a, b;
a:= Re(z); b:= Im(z);
if b = 0 then 0
else
a:= abs(a);
b:= abs(b);
if a = b then a
elif a < b then b, a
else a, b
fi
fi
end proc:
map(h, p3); # Robert Israel, Feb 23 2016
MATHEMATICA
maxNorm = 500;
norm[z_] := Re[z]^2 + Im[z]^2;
m = Sqrt[maxNorm] // Ceiling;
gp = Select[Table[a + b I, {a, 1, m}, {b, 0, m}] // Flatten, norm[#] <= maxNorm && PrimeQ[#, GaussianIntegers -> True]&];
SortBy[gp, norm[#] maxNorm + Abs[Re[#]]&] // Im (* Jean-François Alcover, Feb 26 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Sven Simon, Feb 05 2005; corrected Feb 20 2005 and again on Aug 06 2006
EXTENSIONS
Definition of norm corrected by Franklin T. Adams-Watters, Mar 04 2011
a(48) corrected by Robert Israel, Feb 23 2016
STATUS
approved