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 A368431 #21 Dec 28 2023 15:04:08 %S A368431 0,1,2,3,4,5,6,7,10,8,9,11,12,13,14,15,20,21,18,22,16,17,19,23,24,25, %T A368431 26,27,28,29,30,31,42,40,41,43,44,36,37,45,34,38,46,32,33,35,39,47,50, %U A368431 48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,84,85,82,86 %N A368431 Distinct values of A367562, in order of appearance and with offset 0. %C A368431 This sequence is a permutation of the nonnegative integers (with inverse A368432). %H A368431 Rémy Sigrist, <a href="/A368431/b368431.txt">Table of n, a(n) for n = 0..8191</a> %H A368431 Rémy Sigrist, <a href="/A368431/a368431.gp.txt">PARI program</a> %H A368431 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A368431 The first terms of A367562 and of the present sequence are: %e A368431 k A367562(k) n a(n) %e A368431 -- ---------- -- ---- %e A368431 1 0 0 0 %e A368431 2 1 1 1 %e A368431 3 2 2 2 %e A368431 4 0 %e A368431 5 1 %e A368431 6 3 3 3 %e A368431 7 4 4 4 %e A368431 8 5 5 5 %e A368431 9 2 %e A368431 10 6 6 6 %e A368431 11 0 %e A368431 12 1 %e A368431 13 3 %e A368431 14 7 7 7 %e A368431 15 10 8 10 %t A368431 With[{imax=7},DeleteDuplicates[Map[FromDigits[#,2]&,Flatten[NestList[Map[Delete[{If[Length[#]>1,Map[#<>"0"&,Rest[#]],Nothing],Join[{#[[1]]<>"0"},Map[#<>"1"&,#]]},0]&],{{"0","1"}},imax-1]]]]] (* Generates terms up to order 7 *) (* _Paolo Xausa_, Dec 28 2023 *) %o A368431 (PARI) See Links section. %o A368431 (Python) %o A368431 from itertools import islice %o A368431 from functools import reduce %o A368431 def uniq(r): return reduce(lambda u, e: u if e in u else u+[e], r, []) %o A368431 def agen(): # generator of terms %o A368431 R, aset = [["0", "1"]], set() %o A368431 while R: %o A368431 r = R.pop(0) %o A368431 for b in r: %o A368431 d = int(b, 2) %o A368431 if d not in aset: yield d; aset.add(d) %o A368431 if len(r) > 1: R.append(uniq([r[k]+"0" for k in range(1, len(r))])) %o A368431 R.append(uniq([r[0]+"0", r[0]+"1"] + [r[k]+"1" for k in range(1, len(r))])) %o A368431 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Dec 24 2023 %Y A368431 Cf. A367508, A367562, A368432 (inverse). %K A368431 nonn,look,base %O A368431 0,3 %A A368431 _Rémy Sigrist_, Dec 24 2023