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.

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

This page as a plain text file.
%I A380027 #40 Feb 08 2025 14:09:38
%S A380027 2,3,5,11,41,9699731
%N A380027 a(n) is the largest prime p such that p - a(n-1) is a primorial, starting with a(1) = 2.
%C A380027 From _Michael S. Branicky_, Jan 11 2025: (Start)
%C A380027 The corresponding k are such that 0 <= k < PrimePi(P), so a(n-1)+1 <= a(n) <= a(n-1)+primorial(PrimePi(a(n-1))-1).
%C A380027 a(7) >= 9699731 + primorial(452), which is prime and has 1351 digits, so it is too large to include, even in a b-file. (End)
%F A380027 a(n) = a(n-1) + A002110(A265109(A000720(a(n-1)))), for n > 1. - _Michael S. Branicky_, Jan 10 2025
%e A380027 a(3) = 5
%e A380027 For primes less than 5+5#:
%e A380027 31 - 5 = 26 is not in A002110
%e A380027 ...
%e A380027 13 - 5 = 8 is not in A002110
%e A380027 11 - 5 = 6 is in A002110 so a(4) = 11
%o A380027 (Python)
%o A380027 from itertools import count, islice
%o A380027 from sympy import isprime, primepi, primorial
%o A380027 def A002110(n): return primorial(n) if n > 0 else 1
%o A380027 def agen(an=2): # generator of terms
%o A380027     while True:
%o A380027         yield an
%o A380027         an = next(s for k in range(primepi(an)-1, -1, -1) if isprime(s:=an+A002110(k)))
%o A380027 print(list(islice(agen(), 6))) # _Michael S. Branicky_, Jan 11 2025
%Y A380027 Cf. A002110, A265109, A380026.
%K A380027 nonn
%O A380027 1,1
%A A380027 _Hayden Chesnut_, Jan 09 2025