OFFSET
0,3
COMMENTS
The sequence is conjectured to be a permutation of the positive integers. In the first 200000 terms the only fixed points are 1199 and 14767. It is unknown if more exist.
LINKS
Scott R. Shannon, Image of n=0..200000. The green line is a(n) = n.
EXAMPLE
a(5) = 17 as the concatenation of a(0)..a(4) in binary is "01111011001" and |17 - a(4)| = |17 - 9| = 8 = 1000_2 which does not appear in the concatenated string. Since 1 = 1_2, 2 = 10_2, 3 = 11_2, 4 = 100_2, 5 = 101_2, 6 = 110_2, 7 = 111_2 all appear in the concatenated string, a(5) cannot be less than 17.
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
alst, aset, astr, an, mink, mindiff = [], set(), "", 0, 1, 1
for n in count(0):
yield an; aset.add(an); astr += bin(an)[2:]
prevan, an = an, mink
while an + mindiff <= prevan and (an in aset or bin(abs(an-prevan))[2:] in astr): an += 1
if an in aset or bin(abs(an-prevan))[2:] in astr:
an = max(mink, prevan + mindiff)
while an in aset or bin(an-prevan)[2:] in astr:
an += 1
while mink in aset: mink += 1
while bin(mindiff)[2:] in astr: mindiff += 1
print(list(islice(agen(), 72))) # Michael S. Branicky, Oct 05 2022
CROSSREFS
KEYWORD
AUTHOR
Scott R. Shannon, Sep 12 2022
STATUS
approved