login
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

%I #46 Jan 16 2023 09:10:46

%S 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,

%T 15,61,107,11,67,131,18,86,13,77,141,21,89,25,93,20,84,148,19,83,147,

%U 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

%N 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).

%C 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.

%H Scott R. Shannon, <a href="/A355611/a355611.png">Image of n=0..200000</a>. The green line is a(n) = n.

%e 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.

%o (Python)

%o from itertools import count, islice

%o def agen(): # generator of terms

%o alst, aset, astr, an, mink, mindiff = [], set(), "", 0, 1, 1

%o for n in count(0):

%o yield an; aset.add(an); astr += bin(an)[2:]

%o prevan, an = an, mink

%o while an + mindiff <= prevan and (an in aset or bin(abs(an-prevan))[2:] in astr): an += 1

%o if an in aset or bin(abs(an-prevan))[2:] in astr:

%o an = max(mink, prevan + mindiff)

%o while an in aset or bin(an-prevan)[2:] in astr:

%o an += 1

%o while mink in aset: mink += 1

%o while bin(mindiff)[2:] in astr: mindiff += 1

%o print(list(islice(agen(), 72))) # _Michael S. Branicky_, Oct 05 2022

%Y Cf. A357377 (base 10), A357082, A007088, A030302, A118248, A341766.

%K nonn,base,look

%O 0,3

%A _Scott R. Shannon_, Sep 12 2022