login
Number of different Gaussian primes in the Gaussian prime spiral beginning at the n-th first-quadrant Gaussian prime (A222593).
3

%I #3 Feb 27 2013 16:23:53

%S 4,24,24,4,8,22,22,8,4,8,4,22,8,4,10,92,4,92,10,10,22,22,10,22,22,4,

%T 172,10,10,92,10,10,92,92,4,10,4,10,172,4,4,10,172,92,10,172,172,4,4,

%U 172,172,172,92,10,92,28,172,4,12,92,10,10,172,92,4,12,172,28

%N Number of different Gaussian primes in the Gaussian prime spiral beginning at the n-th first-quadrant Gaussian prime (A222593).

%C This is the idea of A222299 extended to first-quadrant Gaussian primes. The first odd number is a(79) = 29.

%D Joseph O'Rourke and Stan Wagon, Gaussian prime spirals, Mathematics Magazine, vol. 86, no. 1 (2013), p. 14.

%H T. D. Noe, <a href="/A222595/b222595.txt">Table of n, a(n) for n = 1..2829</a>

%t loop[n_] := Module[{p = n, direction = 1}, lst = {n}; While[While[p = p + direction; ! PrimeQ[p, GaussianIntegers -> True]]; direction = direction*(-I); AppendTo[lst, p]; ! (p == n && direction == 1)]; Length[lst]]; nn = 20; ps = {}; Do[If[PrimeQ[i + (j - i) I, GaussianIntegers -> True], AppendTo[ps, i + (j-i)*I]], {j, 0, nn}, {i, 0, j}]; Table[loop[ps[[n]]]; Length[Union[lst]], {n, Length[ps]}]

%Y Cf. A222298 (spiral lengths beginning at the n-th positive real Gaussian prime).

%K nonn

%O 1,1

%A _T. D. Noe_, Feb 27 2013