OFFSET
1,1
COMMENTS
Quadrants are numbered clockwise: 4=north, 1=east, 2=south, 3=west. The spiral numbers falling on axes (whether prime or not) are 4=north (2n+1)^2-n, 1=east (2n+1)^2+n+1, 2=south (2n)^2-(n-1), 3=west (2n)^2+n+1.
Primes to the left, right, above or below the 1 in the example in A054552.
This is the union of the primes in A168022, A168023, A168025 and A168027. - R. J. Mathar, Jul 11 2014
EXAMPLE
For n=0, quadrant = 1, a(1) = 2, distance = 1;
for n=1, quadrant = 1, a(2) = 11, distance = 2;
for n=2, quadrant = 3, a(3) = 19, distance = 2.
MATHEMATICA
Select[ Sort@ Flatten@ Table[ 4n^2 + (2j - 3)n + 1, {j, 0, 3}, {n, 58}], PrimeQ] (* Robert G. Wilson v, Jul 10 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Donald S. McDonald, Jan 10 2003
EXTENSIONS
a(12) onward from Robert G. Wilson v, Jul 10 2014
STATUS
approved