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.

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

This page as a plain text file.
%I A222595 #3 Feb 27 2013 16:23:53
%S A222595 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 A222595 172,10,10,92,10,10,92,92,4,10,4,10,172,4,4,10,172,92,10,172,172,4,4,
%U A222595 172,172,172,92,10,92,28,172,4,12,92,10,10,172,92,4,12,172,28
%N A222595 Number of different Gaussian primes in the Gaussian prime spiral beginning at the n-th first-quadrant Gaussian prime (A222593).
%C A222595 This is the idea of A222299 extended to first-quadrant Gaussian primes. The first odd number is a(79) = 29.
%D A222595 Joseph O'Rourke and Stan Wagon, Gaussian prime spirals, Mathematics Magazine, vol. 86, no. 1 (2013), p. 14.
%H A222595 T. D. Noe, <a href="/A222595/b222595.txt">Table of n, a(n) for n = 1..2829</a>
%t A222595 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 A222595 Cf. A222298 (spiral lengths beginning at the n-th positive real Gaussian prime).
%K A222595 nonn
%O A222595 1,1
%A A222595 _T. D. Noe_, Feb 27 2013