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”).

A365815
a(n) is the least centered n-gonal prime, or -1 if none exists.
2
19, 5, 31, 7, 43, -1, -1, 11, 67, 13, 79, 43, 151, 17, 103, 19, 191, 61, 127, 23, 139, 73, 151, 79, 163, 29, 6091, 31, 311, 97, 199, 103, 211, 37, 223, 229, 1093, 41, 2707, 43, 431, 661, 271, 47, 283, 1009, 491, 151, 307, 53, 3499, 163, 331, 337, 571, 59, 4603, 61
OFFSET
3,1
LINKS
Eric Weisstein's World of Mathematics, Centered Polygonal Number
MATHEMATICA
Table[SelectFirst[n # (# + 1)/2 + 1 & /@ Range[100], PrimeQ], {n, 3, 60}] /. (Missing["NotFound"] -> -1)
PROG
(PARI) a(n) = if ((n==8) || (n==9), return(-1)); my(k=0, p); while (!isprime(p=1+n*k*(k-1)/2), k++); p; \\ Michel Marcus, Sep 27 2023
CROSSREFS
Centered k-gonal primes listed in A276261.
Sequence in context: A358929 A040348 A128050 * A185424 A040347 A040346
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Sep 25 2023
STATUS
approved