A380027 a(n) is the largest prime p such that p - a(n-1) is a primorial, starting with a(1) = 2.
2, 3, 5, 11, 41, 9699731
Offset: 1
Keywords
Examples
a(3) = 5 For primes less than 5+5#: 31 - 5 = 26 is not in A002110 ... 13 - 5 = 8 is not in A002110 11 - 5 = 6 is in A002110 so a(4) = 11
Programs
-
Python
from itertools import count, islice from sympy import isprime, primepi, 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 range(primepi(an)-1, -1, -1) if isprime(s:=an+A002110(k))) print(list(islice(agen(), 6))) # Michael S. Branicky, Jan 11 2025
Comments