--- In

primenumbers@yahoogroups.com,

"Robdine" <robdine@...> asked:

> Is a gaussian number a+bi prime if a^2+b^2 is a (integer)prime

> and if c^2+d^2 is prime then is also c+di a gaussian prime?

These two question appear to be identical;

the second merely changes the word order

and the labelling in the first, without

altering the mathematics in any respect.

In each case, the answer is yes.

Moreover, if a and b are non-zero rational integers, then

a + I*b is a Gaussian prime if and *only* if

a^2 + b^2 is a rational prime.

Note, however, that 3 + I*0 is a Gaussian prime,

but 3^2 + 0^2 is not a rational prime.

To determine whether z is a Gaussian prime

we may use the following procedure:

{isgp(z)=local(a,b,c,t=0);

a=abs(real(z));b=abs(imag(z));

if(type(a)=="t_INT"&&type(b)=="t_INT",c=max(a,b);

if(a*b,t=isprime(a^2+b^2),t=(c%4==3)&&isprime(c)));t;}

for(a=1,7,for(b=0,a,z=a+I*b;if(isgp(z),print1(z", "))));

1 + I, 2 + I, 3, 3 + 2*I, 4 + I, 5 + 2*I, 5 + 4*I, 6 + I, 6 + 5*I, 7, 7 + 2*I,

David