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.

A365815 a(n) is the least centered n-gonal prime, or -1 if none exists.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 25 2023

Keywords

Crossrefs

Centered k-gonal primes listed in A276261.

Programs

  • Mathematica
    Table[SelectFirst[n # (# + 1)/2 + 1 & /@ Range[100], PrimeQ], {n, 3, 60}] /. (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++); p; \\ Michel Marcus, Sep 27 2023