login
A389713
a(1) = 3, a(2) = 5, a(n) is the smallest prime such that a(n) - a(n-1) + 1 is in the sequence.
1
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 101, 103, 107, 109, 113, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283
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
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
Sequence in context: A240699 A065380 A211075 * A038134 A215697 A322184
KEYWORD
nonn
AUTHOR
Elijah Beregovsky, Jan 08 2026
STATUS
approved