login
A357082
a(0) = 0; for n > 0, a(n) is the smallest positive number not occurring earlier such that the binary string of a(n-1) + a(n) does not appear in the binary string concatenation of a(0)..a(n-1).
13
0, 1, 2, 3, 4, 5, 10, 6, 9, 7, 17, 12, 20, 13, 16, 18, 11, 21, 15, 19, 23, 38, 26, 8, 24, 37, 27, 34, 30, 31, 33, 32, 40, 36, 28, 44, 41, 35, 29, 43, 39, 25, 47, 53, 51, 49, 42, 22, 50, 14, 58, 46, 54, 62, 65, 63, 66, 67, 61, 68, 60, 69, 59, 70, 74, 55, 73, 56, 72, 57, 71, 75, 78, 76, 52, 77, 92
OFFSET
0,3
COMMENTS
The main concentration of terms lie along the line a(n) = n, so numerous fixed points exists - there are 301 fixed points in the first 300000 terms. The sequence is conjectured to be a permutation of the positive integers.
LINKS
Michael De Vlieger, Scalar plot of a(n), n = 0..2^16, highlighting records in red, local minima in blue, a(n) = 2^e in green, labeling the indices of certain records and local minima.
Michael De Vlieger, Bitmap of a(n), n = 0..2^11, 12X vertical exaggeration, read horizontally where black represents 1 and white 0, with least significant bit on bottom.
Michael De Vlieger, Bitmap of (a(n-1) + a(n)), n = 1..2^11, 12X vertical exaggeration, read horizontally where black represents 1 and white 0, with least significant bit on bottom.
Scott R. Shannon, Image for n=0..20000.
Scott R. Shannon, Image for n=0..75000.
Scott R. Shannon, Image for n=0..300000.
Scott R. Shannon, Image for n=0..2250000.
EXAMPLE
a(6) = 10 as the concatenation of a(0)..a(5) in binary is "011011100101" and a(5) + 10 = 5 + 10 = 15 = 1111_2 which does not appear in the concatenated string. Since 11 = 1011_2, 12 = 1100_2, 13 = 1101_2, 14 = 1110_2 all appear in the concatenated string, a(6) cannot be 6, 7, 8 or 9.
MATHEMATICA
nn = 77; c[_] = False; j = a[0] = 0; u = 1; w = "0"; Do[k = u; While[Or[c[k], StringContainsQ[w, Set[v, IntegerString[j + k, 2]]]], k++]; Set[{a[n], c[k]}, {k, True}]; Set[{j, w}, {k, w <> IntegerString[k, 2]}]; If[k == u, While[c[u], u++]], {n, nn}]; Array[a, nn + 1, 0] (* Michael De Vlieger, Sep 13 2022 *)
PROG
(Python)
from itertools import islice
def agen():
aset, astr, an, mink = {0}, "0", 0, 1
while True:
yield an; k = mink
while k in aset or bin(an+k)[2:] in astr: k += 1
while mink in aset: mink += 1
an = k; aset.add(an); astr += bin(an)[2:]
print(list(islice(agen(), 77))) # Michael S. Branicky, Sep 16 2022
CROSSREFS
KEYWORD
nonn,base,look
AUTHOR
Scott R. Shannon, Sep 11 2022
EXTENSIONS
Images for n=0..300000 and n=0..2250000 corrected by Scott R. Shannon, Oct 05 2022
STATUS
approved