cp's OEIS Frontend

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.

A365017 a(n) is the least nonnegative integer not already in the sequence whose binary expansion is not the concatenation of any two earlier terms.

This page as a plain text file.
%I A365017 #46 Nov 05 2023 15:00:13
%S A365017 0,1,3,4,5,14,15,16,17,18,20,21,22,24,25,26,27,38,39,46,47,60,61,64,
%T A365017 65,66,68,69,70,72,73,74,80,81,82,84,85,86,88,89,90,96,97,98,100,101,
%U A365017 104,105,106,108,109,115,119,126,127,134,135,142,143,151,156,157,158,166,167,174
%N A365017 a(n) is the least nonnegative integer not already in the sequence whose binary expansion is not the concatenation of any two earlier terms.
%C A365017 a(1)=0 is taken to be a single 0 bit when concatenating.
%H A365017 Attila Kiss, <a href="/A365017/a365017.java.txt">Java code to generate terms</a>.
%e A365017 The number 2 is excluded because its binary expansion is "10", which is the concatenation of a(1)="1" and a(0)="0".
%e A365017 The number 19 is excluded because its binary expansion is "10011", which is the concatenation of a(4)="100" and a(3)="11".
%t A365017 conc[x_, y_] := FromDigits[Flatten@IntegerDigits[{x, y}, 2], 2]; a[1] = 0; a[n_] := a[n] = Module[{k = a[n - 1] + 1, v = Array[a, n - 1], c}, c = conc @@@ Select[Tuples[v, {2}], UnsameQ @@ # &]; While[! FreeQ[c, k], k++]; k]; Array[a, 60] (* _Amiram Eldar_, Sep 29 2023 *)
%o A365017 (Python)
%o A365017 from itertools import islice
%o A365017 def agen(): # generator of terms
%o A365017     an, bins, concats = 0, {"0"}, set()
%o A365017     while True:
%o A365017         yield an
%o A365017         while (bn:=bin(an:=an+1)[2:]) in concats: pass
%o A365017         concats |= {bn+bi for bi in bins} | {bi+bn for bi in bins}
%o A365017         bins.add(bn)
%o A365017 print(list(islice(agen(),62))) # _Michael S. Branicky_, Sep 29 2023
%Y A365017 Cf. A365018, A364871.
%K A365017 nonn,base
%O A365017 1,3
%A A365017 _Attila Kiss_, Aug 16 2023