# Can we find Gaussian primes $\pi = 1 + 8 \mathbb{Z}[i]$ with $N(\pi) < 10000$?

It's an exercise in computational number theory. Either by hand or by computer, can we find the Gaussian primes $\pi = 1 + 8 \mathbb{Z}[i]$? To keep the list finite I guess we could have $N(\pi) < 10000$.

For example, is $\mathfrak{p} = (1+8i)$ a prime? Or $\mathfrak{p} = (-7 + 8i)$? I don't even know how to index the primes less than these. The norms are $1^2 + 8^2 = 65 = 5 \times 13$ and $(-7)^2 + 8^2 = 113$, so the first could factor and the second does not.

For $\mathfrak{p} = (a + bi)$ to check it is prime over $\mathbb{Z}[i]$, is it sufficient to check that $N(\mathfrak{p}) = a^2 + b^2$ is a prime over $\mathbb{Z}$?

It would be great to see the code in Sage or Pari/GP and that would be an acceptable answer.

edit retag close merge delete

Sort by ยป oldest newest most voted

Let $a+bi$ be a prime in $\Bbb Z[i]$. We can multiply it with $\pm1$ to have $a\ge 0$. Also, we can pass to the conjugate to have also the case $b\ge 0$. After these norming steps, $0\le a,b$. In case $a < b$, one can multiply with $i$ and renorm. So we are searching for primes of the form $a+ib$ where $0\le b\le a$.

Warming-up: It is simple to see if a number in $\Bbb Z[i]$ is prime or not. Dialog with the sage interpreter:

sage: K.<j> = QuadraticField( -1 )
sage: K(2018 + 2019*j).factor()
(-1) * (86*j - 139) * (-6*j - 5) * (-j - 2)
sage: K(2017).factor()
(-9*j - 44) * (9*j - 44)
sage: 2020.next_prime()
2027
sage: K(2027).factor()
2027
sage: K(2027).is_prime()
True

sage: K(1+8*j).factor()
(-3*j - 2) * (-j - 2)
sage: K(1+8*j).is_prime()
False

sage: K(-7+8*j).factor()
(j) * (7*j + 8)
sage: K(-7+8*j).is_prime()
True


To collect now all "normed" primes of the given shape with "real" and "imaginary" part up to a given bound we can try:

K.<j> = QuadraticField( -1 )
BOUND = 40
my_primes = []

for a in xrange( BOUND/8 ):
for b in xrange( 1+8*a+1 ):
p = 1 + 8*a + b*j
if p.is_prime():
my_primes.append(p)

for p in my_primes:
print p


Above, there is a "decent bound", so i can print here the results:

j + 1
4*j + 9
2*j + 17
8*j + 17
10*j + 17
12*j + 17
4*j + 25
6*j + 25
12*j + 25
14*j + 25
16*j + 25
22*j + 25
24*j + 25
2*j + 33
8*j + 33
20*j + 33
28*j + 33
32*j + 33

more
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}