OFFSET
0,6
COMMENTS
These are the primes in the ring of integers a+bi, a and b rational integers, i = sqrt(-1).
Two primes are considered equivalent if they differ by multiplication by a unit (+-1, +-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.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = A055028(n)/4.
a(n) = 2 if n is a prime = 1 (mod 4); a(n) = 1 if n is 2, or p^2 where p is a prime = 3 (mod 4); a(n) = 0 otherwise. - Franklin T. Adams-Watters, May 05 2006
EXAMPLE
There are 8 Gaussian primes of norm 5, +-1+-2i and +-2+-i, but only two inequivalent ones (2+-i).
MATHEMATICA
a[n_ /; PrimeQ[n] && Mod[n, 4] == 1] = 2; a[2] = 1; a[n_ /; (p = Sqrt[n]; PrimeQ[p] && Mod[p, 4] == 3)] = 1; a[_] = 0; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 25 2011, after Franklin T. Adams-Watters *)
PROG
(Haskell)
a055029 2 = 1
a055029 n = 2 * a079260 n + a079261 (a037213 n)
-- Reinhard Zumkeller, Nov 11 2012
(PARI) a(n)=if(isprime(n), if(n%4==1, 2, n==2), if(issquare(n, &n) && isprime(n) && n%4==3, 1, 0)) \\ Charles R Greathouse IV, Feb 07 2017
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Jun 09 2000
EXTENSIONS
More terms from Reiner Martin, Jul 20 2001
STATUS
approved