cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239397 Prime Gaussian integers x + y*i sorted by norm and increasing y, with x and y nonnegative.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Mar 22 2014

Keywords

Comments

After the number 1 + i, there are exactly two Gaussian primes here for each norm in A055025; if x + y*i is here, then y + x*i is also. - T. D. Noe, Mar 26 2014
Sequence A239621 provides a more condensed version, without y + x*i following each x + y*i. The real parts and imaginary parts are listed in A300587 and A300588. - M. F. Hasler, Mar 09 2018

Examples

			The sequence of Gaussian primes (with nonnegative real and imaginary part) begins 1+i, 2+i, 1+2i, 3, 3i,...
		

Crossrefs

Cf. A055025 (norms of Gaussian primes), A239621, A300587, A300588.

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