login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A355611
a(0) = 0; for n > 0, a(n) is the smallest positive number not occurring earlier such that the binary string of |a(n) - a(n-1)| does not appear in the binary string concatenation of a(0)..a(n-1).
5
0, 1, 3, 5, 9, 17, 7, 23, 2, 12, 22, 6, 16, 37, 58, 10, 38, 4, 32, 60, 14, 48, 82, 8, 42, 85, 15, 61, 107, 11, 67, 131, 18, 86, 13, 77, 141, 21, 89, 25, 93, 20, 84, 148, 19, 83, 147, 27, 91, 155, 26, 90, 154, 24, 88, 152, 28, 92, 156, 36, 100, 164, 30, 94, 158, 29, 142, 78, 191, 31, 95, 159
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
Sequence in context: A348125 A135575 A354910 * A306973 A130114 A143106
KEYWORD
nonn,base,look
AUTHOR
Scott R. Shannon, Sep 12 2022
STATUS
approved