login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285791 Primes equal to a heptagonal number plus 1. 4
2, 19, 113, 149, 541, 617, 971, 1289, 1783, 2357, 3011, 3187, 5689, 6427, 7481, 7757, 9829, 12497, 12853, 14327, 15881, 17099, 18793, 21023, 24851, 28463, 30637, 31193, 45361, 50909, 54539, 60607, 63761, 66179, 69473, 70309, 83449, 88079, 90917, 91873, 94771 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
PROG
(PARI) pg(m, n) = (n^2*(m-2)-n*(m-4))/2 \\ n-th m-gonal number
maxk=300; L=List(); for(k=1, maxk, if(isprime(p=pg(7, k) + 1), listput(L, p))); Vec(L)
(Python)
from sympy import isprime
def heptagonal(n): return n*(5*n-3)//2
def aupto(limit):
alst, n, hn = [], 1, heptagonal(1)
while hn < limit:
if isprime(hn+1): alst.append(hn+1)
n, hn = n+1, heptagonal(n+1)
return alst
print(aupto(94771)) # Michael S. Branicky, Feb 19 2021
CROSSREFS
Sequence in context: A089659 A240124 A278405 * A101253 A082291 A055518
KEYWORD
nonn
AUTHOR
Colin Barker, Apr 26 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)