A380026 a(n) is the smallest prime p such that p - a(n-1) is a primorial, starting with a(1)=2.
2, 3, 5, 7, 13, 19, 229, 439, 2749, 5059, 7369, 9679, 39709, 42019, 6469735249, 5766152219975951659023630035336134306565384015606066326325804059, 5766152219975951659023630035336134306565384015606073747063938869, 5766152219975951659023630035336134306565384015606073747287031739
Offset: 1
Keywords
Examples
a(4) = 7 For primes greater than 7: 11 - 7 = 4 is not in A002110 13 - 7 = 6 is in A002110 so a(5) = 13
Programs
-
Python
from itertools import count, islice from sympy import isprime, primorial def A002110(n): return primorial(n) if n > 0 else 1 def agen(an=2): # generator of terms while True: yield an an = next(s for k in count(0) if isprime(s:=an+A002110(k))) print(list(islice(agen(), 18))) # Michael S. Branicky, Jan 10 2025
-
Python
from sympy import isprime import primesieve it = primesieve.Iterator() chain = [2] pchain = [] n = 1 while len(chain) < 18: while True: p = it.next_prime() if isprime(chain[-1]+n): chain.append(chain[-1]+n) print(len(chain)) break n *= p p = it.skipto(0) n = 1 print(chain) # Hayden Chesnut, Jan 10 2025