OFFSET
1,2
COMMENTS
By Dirichlet's theorem on arithmetic progressions, we can always extend the sequence: say a(n) < 2^k, then a(n) OR 1 and 2^k are coprime and there are infinitely many prime numbers of the form (a(n) OR 1) + m*2^k = a(n) OR (1 + m*2^k) and we can extend the sequence.
Will every integer appear in this sequence?
Numerous sequences are based on the same model: the sequence is the lexicographically earliest sequence of distinct positive terms such that some function in two variables yields prime numbers when applied to consecutive terms:
f(u,v) Analog sequence
------- -----------------
u OR v a (this sequence)
u + v A055265
u*v + 1 A073666
u*v - 1 A081943
abs(u-v) A065186
max(u,v) A282649
u^2 + v^2 A100208
The appearance of numbers much earlier or later than their corresponding index is flagged strikingly in the plot2 graph of a(n)/n (see links). - Peter Munn, Sep 10 2022
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Peter Munn, Plot2 graph of a(n)/n
EXAMPLE
The first terms, alongside a(n) OR a(n+1), are:
n a(n) a(n) OR a(n+1)
-- ---- --------------
1 1 3
2 2 3
3 3 7
4 4 5
5 5 7
6 6 7
7 7 23
8 16 29
9 13 13
10 8 11
11 11 11
12 9 11
PROG
(PARI) s=0; v=1; for (n=1, 67, s+=2^v; print1 (v ", "); for (w=1, oo, if (!bittest(s, w) && isprime(o=bitor(v, w)), v=w; break)))
(Python)
from sympy import isprime
from itertools import count, islice
def agen():
aset, k, mink = {1}, 1, 2
for n in count(1):
an = k; yield an; aset.add(an)
s, k = set(str(an)), mink
while k in aset or not isprime(an|k): k += 1
while mink in aset: mink += 1
print(list(islice(agen(), 67))) # Michael S. Branicky, Sep 10 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 20 2019
STATUS
approved