login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A078765
Prime numbers occurring at integer Pythagorean distance (radius) from 1 in Ulam square prime-spiral. Primes on axes are excluded.
0
227, 239, 271, 997, 1021, 1061, 2243, 2251, 2311, 2339, 2347, 3527, 4153, 4217, 6311, 6491, 6551, 6971, 9059, 9109, 9133, 9341, 9397, 12671, 14549, 16273, 16369, 16529, 19507, 20551, 20611, 20719, 20899, 20983, 25301, 25343, 25621, 25741, 27893
OFFSET
1,1
COMMENTS
Note that prime numbers on an axis are automatically an integer distance from 1.
EXAMPLE
a(1) = 227, a prime number: distance from 1 off-axis = (6,8,10) triangle.
PROG
(PARI) { uc(n) = k = (sqrtint(4*n-3)-1)\2; d=n-1-k*(k+1); if(k%2, c=[(k+1)\2-min(d, k+1), (k+1)\2-max(d-k-1, 0)], c=[-k\2+min(d, k+1), -k\2+max(d-k-1, 0)] ); c }
forprime(p=2, 10^5, t=uc(p); if( t[1]!=0 && t[2]!=0 && issquare(t[1]^2+t[2]^2), print1(p, ", "))) \\ Max Alekseyev
CROSSREFS
Sequence in context: A098247 A092994 A031513 * A179141 A259059 A333425
KEYWORD
nonn
AUTHOR
Donald S. McDonald, Jan 09 2003
EXTENSIONS
More terms from Max Alekseyev, Jan 28 2012
STATUS
approved