A383596 Integers in Ulam's spiral for which the numbers around them form a square whose four corners are all prime numbers.
71, 95, 353, 701, 767, 1151, 1451, 1961, 2507, 3347, 4691, 5957, 7205, 9671, 13463, 15635, 21017, 26051, 27947, 28985, 34337, 42017, 49565, 50921, 52253, 52349, 55859, 57191, 63143, 75857, 79907, 80831, 81611, 92339, 101633, 102557, 106529, 110495, 114521, 116513, 121469, 131075, 136757, 137879, 144497
Offset: 1
Keywords
Examples
71 is in this sequence, since the numbers around 71 in Ulam's spiral are 41, 42, 43, 70, 72, 107, 108 and 109, where the prime numbers 107, 109, 43 and 41 are the vertices of a square whose center is 71. . . . - 109 - 72 - 43 - - 108 - 71 - 42 - - 107 - 70 - 41 - . . .
Programs
-
Python
from sympy import isprime def ulam(x, y): k = max(abs(x), abs(y)) return (2*k) ** 2 + 1 + (-1 if x > -y else 1) * (2*k + x - y) def is_A383596(n): x = A174344(n) y = A274923(n) return all(isprime(ulam(x + i, y + j)) for i in (-1, 1) for j in (-1, 1)) # David Radcliffe, Aug 04 2025
Extensions
a(45) corrected by David Radcliffe, Aug 04 2025
Comments