login
A365445
a(n) is the index of the least prime that is also a centered n-gonal number, or -1 if none exists.
2
8, 3, 11, 4, 14, -1, -1, 5, 19, 6, 22, 14, 36, 7, 27, 8, 43, 18, 31, 9, 34, 21, 36, 22, 38, 10, 795, 11, 64, 25, 46, 27, 47, 12, 48, 50, 183, 13, 394, 14, 83, 121, 58, 15, 61, 169, 94, 36, 63, 16, 489, 38, 67, 68, 105, 17, 623, 18, 73, 74, 75, 44, 347
OFFSET
3,1
LINKS
Eric Weisstein's World of Mathematics, Centered Polygonal Number
FORMULA
a(n) = A000720(A365815(n)). - Michel Marcus, Sep 27 2023
MATHEMATICA
Table[PrimePi[SelectFirst[n # (# + 1)/2 + 1 & /@ Range[100], PrimeQ]], {n, 3, 65}] /. (PrimePi[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++); primepi(p); \\ Michel Marcus, Sep 27 2023
CROSSREFS
Centered k-gonal primes listed in A276261.
Sequence in context: A069610 A257811 A122159 * A069200 A069218 A248295
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Sep 25 2023
STATUS
approved