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.

A103432 Subsequence of the Gaussian primes, where only Gaussian primes a+bi with a>0, b>=0 are listed. Ordered by the norm N(a+bi)=a^2+b^2 and the size of the real part when the norms are equal. The sequence gives the imaginary parts. See A103431 for the real parts.

This page as a plain text file.
%I A103432 #20 Feb 26 2019 05:06:12
%S A103432 1,2,1,0,3,2,4,1,5,2,6,1,5,4,0,7,2,6,5,8,3,8,5,9,4,10,1,10,3,8,7,0,11,
%T A103432 4,10,7,11,6,13,2,10,9,12,7,14,1,15,2,13,8,15,4,16,1,13,10,14,9,16,5,
%U A103432 17,2,13,12,14,11,16,9,18,5,17,8,0,18,7,17,10,19,6,20,1,20,3,15,14,17
%N A103432 Subsequence of the Gaussian primes, where only Gaussian primes a+bi with a>0, b>=0 are listed. Ordered by the norm N(a+bi)=a^2+b^2 and the size of the real part when the norms are equal. The sequence gives the imaginary parts. See A103431 for the real parts.
%C A103432 Detailed description in A103431.
%H A103432 Robert Israel, <a href="/A103432/b103432.txt">Table of n, a(n) for n = 1..10000</a>
%H A103432 Sven Simon, <a href="/A103431/a103431_1.txt">List with Gaussian primes of A103431/A103432</a>
%p A103432 N:= 100: # to get all terms with norm <= N
%p A103432 p1:= select(isprime,[seq(i,i=3..N,4)]):
%p A103432 p2:= select(isprime,[seq(i,i=1..N^2,4)]):
%p A103432 p2:= map(t -> GaussInt:-GIfactors(t)[2][1][1],p2):
%p A103432 p3:= sort( [1+I, op(p1),op(p2)],(a,b) -> Re(a)^2 + Im(a)^2  < Re(b)^2 + Im(b)^2):
%p A103432 h:= proc(z)
%p A103432     local a,b;
%p A103432     a:= Re(z); b:= Im(z);
%p A103432     if b = 0 then 0
%p A103432     else
%p A103432       a:= abs(a);
%p A103432       b:= abs(b);
%p A103432       if a = b then a
%p A103432       elif a < b then b,a
%p A103432       else a,b
%p A103432       fi
%p A103432     fi
%p A103432 end proc:
%p A103432 map(h,p3); # _Robert Israel_, Feb 23 2016
%t A103432 maxNorm = 500;
%t A103432 norm[z_] := Re[z]^2 + Im[z]^2;
%t A103432 m = Sqrt[maxNorm] // Ceiling;
%t A103432 gp = Select[Table[a + b I, {a, 1, m}, {b, 0, m}] // Flatten, norm[#] <= maxNorm && PrimeQ[#, GaussianIntegers -> True]&];
%t A103432 SortBy[gp, norm[#] maxNorm + Abs[Re[#]]&] // Im (* _Jean-François Alcover_, Feb 26 2019 *)
%K A103432 nonn
%O A103432 1,2
%A A103432 _Sven Simon_, Feb 05 2005; corrected Feb 20 2005 and again on Aug 06 2006
%E A103432 Definition of norm corrected by _Franklin T. Adams-Watters_, Mar 04 2011
%E A103432 a(48) corrected by _Robert Israel_, Feb 23 2016