cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A365445 a(n) is the index of the least prime that is also a centered n-gonal number, or -1 if none exists.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 25 2023

Keywords

Crossrefs

Centered k-gonal primes listed in A276261.

Programs

  • Mathematica
    Table[PrimePi[SelectFirst[n # (# + 1)/2 + 1 & /@ Range[100], PrimeQ]], {n, 3, 65}] /. (PrimePi[Missing["NotFound"]] -> -1)
  • 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

Formula

a(n) = A000720(A365815(n)). - Michel Marcus, Sep 27 2023