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.

This page as a plain text file.
%I A055028 #21 Oct 30 2022 18:19:59
%S A055028 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,
%T A055028 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,
%U A055028 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
%N A055028 Number of Gaussian primes of norm n.
%C A055028 These are the primes in the ring of integers a+bi, a and b rational integers, i = sqrt(-1).
%D A055028 R. K. Guy, Unsolved Problems in Number Theory, A16.
%D A055028 L. W. Reid, The Elements of the Theory of Algebraic Numbers, MacMillan, NY, 1910, see Chap. V.
%H A055028 Seiichi Manyama, <a href="/A055028/b055028.txt">Table of n, a(n) for n = 0..10000</a>
%H A055028 <a href="/index/Ga#gaussians">Index entries for Gaussian integers and primes</a>
%F A055028 a(n) = 4 * A055029(n). - _Franklin T. Adams-Watters_, May 05 2006
%e A055028 There are 8 Gaussian primes of norm 5, +-1 +- 2i and +-2 +- i, but only two inequivalent ones (2 +- i).
%p A055028 A055028 := proc(n::integer)
%p A055028     local c,a,b ;
%p A055028     c := 0 ;
%p A055028     for a from -n to n do
%p A055028         if issqr(n-a^2) then
%p A055028             b := sqrt(n-a^2) ;
%p A055028             if GaussInt[GIprime](a+b*I) and a^2+b^2=n then
%p A055028                 if b = 0 then
%p A055028                     c := c+1 ; # a+i*b and a-i*b
%p A055028                 else
%p A055028                     c := c+2 ; # a+i*b and a-i*b
%p A055028                 end if;
%p A055028             end if;
%p A055028         end if;
%p A055028     end do:
%p A055028     c ;
%p A055028 end proc:
%p A055028 seq( A055028(n),n=0..50) ; # _R. J. Mathar_, Jul 22 2021
%t A055028 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_ *)
%Y A055028 Cf. A055025-A055029, A055664-... , A295996.
%K A055028 nonn,easy,nice
%O A055028 0,3
%A A055028 _N. J. A. Sloane_, Jun 09 2000
%E A055028 More terms from _Reiner Martin_, Jul 20 2001