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
LINKS
OEIS Wiki, Ulam spiral
Alonso del Arte, Ulam spiral (2009). [EmdrGreg's comment suggested the odd number spiral variant.]
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) is(n)=n>9 && isprime(8*n^2+6*n-1) \\ Charles R Greathouse IV, Jan 21 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alonso del Arte, Mar 21 2011
STATUS
approved