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.

A055028 Number of Gaussian primes of norm n.

Original entry on oeis.org

0, 0, 4, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Jun 09 2000

Keywords

Comments

These are the primes in the ring of integers a+bi, a and b rational integers, i = sqrt(-1).

Examples

			There are 8 Gaussian primes of norm 5, +-1 +- 2i and +-2 +- i, but only two inequivalent ones (2 +- i).
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A16.
  • L. W. Reid, The Elements of the Theory of Algebraic Numbers, MacMillan, NY, 1910, see Chap. V.

Crossrefs

Programs

  • Maple
    A055028 := proc(n::integer)
        local c,a,b ;
        c := 0 ;
        for a from -n to n do
            if issqr(n-a^2) then
                b := sqrt(n-a^2) ;
                if GaussInt[GIprime](a+b*I) and a^2+b^2=n then
                    if b = 0 then
                        c := c+1 ; # a+i*b and a-i*b
                    else
                        c := c+2 ; # a+i*b and a-i*b
                    end if;
                end if;
            end if;
        end do:
        c ;
    end proc:
    seq( A055028(n),n=0..50) ; # R. J. Mathar, Jul 22 2021
  • Mathematica
    a[n_ /; PrimeQ[n] && Mod[n, 4] == 1] = 8; a[2] = 4; a[n_ /; (p = Sqrt[n]; PrimeQ[p] && Mod[p, 4] == 3)] = 4; a[] = 0; Table[ a[n], {n, 0, 100}] (* _Jean-François Alcover, Jul 30 2013, after Franklin T. Adams-Watters *)

Formula

a(n) = 4 * A055029(n). - Franklin T. Adams-Watters, May 05 2006

Extensions

More terms from Reiner Martin, Jul 20 2001