OFFSET
1,1
COMMENTS
In a variant of the Ulam spiral in which only odd numbers are entered, some primes still line up along some diagonals but not others. Without the even numbers, primes can also line up in horizontal and diagonal lines. This sequence comes from an upwards vertical line which starts with 13.
Primes of A091823. - Klaus Purath, Jan 03 2021
This is a subsequence of A162761. - Davide Rotondo, Jun 14 2025
LINKS
Alonso del Arte, Ulam spiral (2009). [EmdrGreg's comment suggested the odd number spiral variant.]
OEIS Wiki, Ulam spiral
FORMULA
a(n) = 2((2n - 1)^2 - n) - 1 (or, find the number in the corresponding spot in the better-known Ulam spiral, double it and subtract 1).
The polynomial 8n^2 - 10n + 1 produces the same primes.
MATHEMATICA
Select[Table[2((2n - 1)^2 - n) - 1, {n, 100}], PrimeQ]
PROG
(Magma) [ a: n in [0..2500] | IsPrime(a) where a is 8*n^2 + 6*n - 1 ]; // Vincenzo Librandi, Apr 24 2011
(PARI) lista(nn) = my(list=List(), p); for (n=1, nn, if(isprime(p=8*n^2+6*n-1), listput(list, p))); Vec(list); \\ Michel Marcus, Jun 14 2025
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alonso del Arte, Mar 21 2011
STATUS
approved
