This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A360521 #40 Oct 24 2024 17:53:55 %S A360521 0,1,2,3,4,5,10,6,9,7,17,15,18,14,19,13,20,12,21,11,22,26,8,24,27,37, %T A360521 28,23,25,39,29,35,30,34,31,33,32,36,41,44,43,42,38,62,57,70,58,69,59, %U A360521 68,60,67,61,66,63,64,65,71,76,52,84,72,56,80,48,88,40,96,51,77,83,45,91,81,47,89,86 %N A360521 a(0) = 0; for n > 0, a(n) is the smallest positive number not occurring earlier such that neither the binary string a(n-1) + a(n) nor the same string reversed appear in the binary string concatenation of a(0)..a(n-1). %C A360521 As in A357082 the main concentration of terms is along the line a(n) = n, so there are numerous fixed points - there are 24 fixed points in the first 200000 terms. The sequence is conjectured to be a permutation of the positive integers. %C A360521 Note that when the binary string of a(n-1) + a(n) is reversed any resulting leading 0's are retained for the string comparison. %H A360521 Michael S. Branicky, <a href="/A360521/b360521.txt">Table of n, a(n) for n = 0..10000</a> %H A360521 Scott R. Shannon, <a href="/A360521/a360521_2.png">Image for n=0..60000</a>. %H A360521 Scott R. Shannon, <a href="/A360521/a360521_1.png">Image for n=0..200000</a>. The tip of the large right-pointing 'arrow' corresponds to the term a(159580) = 131072 = 100000000000000000_2. %H A360521 Scott R. Shannon, <a href="/A360521/a360521_3.png">Image for n=0..600000</a>. %H A360521 Scott R. Shannon, <a href="/A360521/a360521_4.png">Image of first million terms</a>. %H A360521 Scott R. Shannon and Zach J. Shannon, <a href="/A360521/a360521_5.png">Image of first ten million terms</a>. This is a high resolution image so zoom in to see the details. %H A360521 Scott R. Shannon and Zach J. Shannon, <a href="/A360521/a360521_6.png">Image of first thirty six million terms</a>. This is a high resolution image so zoom in to see the details. %e A360521 a(11) = 15 as the concatenation of a(0)..a(10) in binary is "0110111001011010110100111110001" and a(10) + 15 = 17 + 15 = 32 = 100000_2 which does not appear in the concatenated string, nor does its reverse "000001". Although 17 + 12 = 29 = 11101_2 does not appear in the string its reverse "10111" does, so a(11) cannot be 12. This is the first term to differ from A357082. %t A360521 nn = 76; 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]]], StringContainsQ[w, StringReverse[v]]], 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_, Feb 15 2023 *) %o A360521 (Python) %o A360521 from itertools import islice %o A360521 def agen(): # generator of terms %o A360521 an, astr, aset, mink = 0, "", set(), 1 %o A360521 while True: %o A360521 yield an %o A360521 s = bin(an)[2:] %o A360521 astr += s %o A360521 k = mink %o A360521 while k in aset or (t:=bin(an+k)[2:]) in astr or t[::-1] in astr: %o A360521 k += 1 %o A360521 an = k %o A360521 aset.add(an) %o A360521 while mink in aset: mink += 1 %o A360521 print(list(islice(agen(), 80))) # _Michael S. Branicky_, Feb 10 2023 %Y A360521 Cf. A357082, A007088, A030302, A118248, A341766. %K A360521 nonn,look,base,nice %O A360521 0,3 %A A360521 _Scott R. Shannon_, Feb 09 2023