A239397 Prime Gaussian integers x + y*i sorted by norm and increasing y, with x and y nonnegative.
1, 1, 2, 1, 1, 2, 3, 0, 0, 3, 3, 2, 2, 3, 4, 1, 1, 4, 5, 2, 2, 5, 6, 1, 1, 6, 5, 4, 4, 5, 7, 0, 0, 7, 7, 2, 2, 7, 6, 5, 5, 6, 8, 3, 3, 8, 8, 5, 5, 8, 9, 4, 4, 9, 10, 1, 1, 10, 10, 3, 3, 10, 8, 7, 7, 8, 11, 0, 0, 11, 11, 4, 4, 11, 10, 7, 7, 10, 11, 6, 6, 11, 13, 2
Offset: 1
Examples
The sequence of Gaussian primes (with nonnegative real and imaginary part) begins 1+i, 2+i, 1+2i, 3, 3i,...
Links
- T. D. Noe, Table of n, a(n) for n = 1..10002 (5001 complex numbers)
- Eric Weisstein's World of Mathematics, Gaussian prime
- Wikipedia, Complex Number
Programs
-
Mathematica
mx = 20; lst = Flatten[Table[{a, b}, {a, 0, mx}, {b, 0, mx}], 1]; qq = Select[lst, Norm[#] <= mx && PrimeQ[#[[1]] + I*#[[2]], GaussianIntegers -> True] &]; Sort[qq, Norm[#1] < Norm[#2] &]
-
PARI
is_GP(x,y=0)={(x=factor(if(imag(x+I*y),x+I*y,I*x+y)))&&vecsum(x[,2])==1+(abs(x[1,1])==1)} \\ Returns 1 iff x + iy (y may be omitted) is a Gaussian prime. - M. F. Hasler, Mar 10 2018
-
PARI
for(N=2,499, if(isprime(N) && N%4<3, z=factor(I*N); for(i=0,N>2, print1(real(z[i+1,1])","imag(z[i+1,1])",")), issquare(N,&z) && isprime(z) && z%4==3 && print1(z",0,0,"z","))) \\ M. F. Hasler, Mar 10 2018
Formula
a(4n + 1) = a(4n) = A239621(2n) = A300588(n), a(4n + 2) = a(4n-1) = A239621(2n-1) = A300587(n). - M. F. Hasler, Mar 09 2018
Comments