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.

A380026 a(n) is the smallest prime p such that p - a(n-1) is a primorial, starting with a(1)=2.

This page as a plain text file.
%I A380026 #26 Jan 21 2025 15:10:24
%S A380026 2,3,5,7,13,19,229,439,2749,5059,7369,9679,39709,42019,6469735249,
%T A380026 5766152219975951659023630035336134306565384015606066326325804059,
%U A380026 5766152219975951659023630035336134306565384015606073747063938869,5766152219975951659023630035336134306565384015606073747287031739
%N A380026 a(n) is the smallest prime p such that p - a(n-1) is a primorial, starting with a(1)=2.
%F A380026 a(n) = a(n-1) + A002110(A100380(A000720(a(n-1)))), for n > 1. - _Michael S. Branicky_, Jan 10 2025
%e A380026 a(4) = 7
%e A380026 For primes greater than 7:
%e A380026 11 - 7 = 4 is not in A002110
%e A380026 13 - 7 = 6 is in A002110 so a(5) = 13
%o A380026 (Python)
%o A380026 from itertools import count, islice
%o A380026 from sympy import isprime, primorial
%o A380026 def A002110(n): return primorial(n) if n > 0 else 1
%o A380026 def agen(an=2): # generator of terms
%o A380026     while True:
%o A380026         yield an
%o A380026         an = next(s for k in count(0) if isprime(s:=an+A002110(k)))
%o A380026 print(list(islice(agen(), 18))) # _Michael S. Branicky_, Jan 10 2025
%o A380026 (Python)
%o A380026 from sympy import isprime
%o A380026 import primesieve
%o A380026 it = primesieve.Iterator()
%o A380026 chain = [2]
%o A380026 pchain = []
%o A380026 n = 1
%o A380026 while len(chain) < 18:
%o A380026     while True:
%o A380026         p = it.next_prime()
%o A380026         if isprime(chain[-1]+n):
%o A380026             chain.append(chain[-1]+n)
%o A380026             print(len(chain))
%o A380026             break
%o A380026         n *= p
%o A380026     p = it.skipto(0)
%o A380026     n = 1
%o A380026 print(chain) # _Hayden Chesnut_, Jan 10 2025
%Y A380026 Cf. A000720, A002110, A100380, A380027.
%K A380026 nonn
%O A380026 1,1
%A A380026 _Hayden Chesnut_, Jan 09 2025