OFFSET
1,1
COMMENTS
It is unknown whether this sequence is infinite.
REFERENCES
Paul Erdős and Ronald Graham, Old and new problems and results in combinatorial number theory, Monographies de L'Enseignement Mathématique (1980).
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Thomas Bloom, Problem #472, Erdős Problems.
EXAMPLE
a(3) = a(1) + a(2) - 1 = 7.
The first prime missing from this sequence is 97, because 97 - 89 + 1 = 9, which is not prime.
MATHEMATICA
a={3, 5}; For[i=3, i<100, i++, AppendTo[a, Module[{p=NextPrime@a[[-1]]}, While[Not@MemberQ[a, p-a[[-1]]+1], p=NextPrime[p]]; p]]]; a
PROG
(Python)
from gmpy2 import next_prime
from itertools import islice
def agen():
aset, an = {3}, 5
yield 3
while True:
yield an
aset.add(an)
p, ub = next_prime(an), 2*an - 1
while p - an + 1 not in aset and p <= ub:
p = next_prime(p)
if p > ub:
print("Sequence is finite")
return
an = int(p)
print(list(islice(agen(), 58))) # Michael S. Branicky, Jan 09 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Elijah Beregovsky, Jan 08 2026
STATUS
approved
