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.

A261922 a(n) = smallest nonnegative number that is not a substring of n in its binary representation.

This page as a plain text file.
%I A261922 #17 Sep 21 2023 11:10:17
%S A261922 1,0,3,0,3,3,4,0,3,3,3,4,5,4,4,0,3,3,3,5,3,3,4,4,5,5,4,4,5,4,4,0,3,3,
%T A261922 3,5,3,3,5,5,3,3,3,4,7,4,4,4,5,5,5,5,7,4,4,4,5,5,4,4,5,4,4,0,3,3,3,5,
%U A261922 3,3,5,5,3,3,3,6,5,7,5,5,3,3,3,6,3,3,4,4,7,7,4,4,8,4,4,4,5,5,5,5,5,7
%N A261922 a(n) = smallest nonnegative number that is not a substring of n in its binary representation.
%H A261922 Reinhard Zumkeller, <a href="/A261922/b261922.txt">Table of n, a(n) for n = 0..10000</a>
%F A261922 From _Reinhard Zumkeller_, Sep 17 2015: (Start)
%F A261922 a(A062289(n)) = A261461(A062289(n)).
%F A261922 a(A126646(n)) != A261461(A126646(n)). (End)
%o A261922 (Haskell)
%o A261922 import Data.List (isInfixOf)
%o A261922 a261922 x = f a030308_tabf where
%o A261922    f (cs:css) = if isInfixOf cs (a030308_row x)
%o A261922                    then f css else foldr (\d v -> 2 * v + d) 0 cs
%o A261922 -- _Reinhard Zumkeller_, Sep 17 2015
%o A261922 (PARI) bstr(n) = if (n==0, "0", my(s="", b=binary(n)); for (i=1, #b, s=concat(s, b[i])); s);
%o A261922 a(n) = my(sn=btostr(n), k=0); while (#strsplit(sn, bstr(k)) != 1, k++); k; \\ _Michel Marcus_, Sep 20 2023
%o A261922 (Python)
%o A261922 def a(n): b=bin(n)[2:]; return next(k for k in range(2**len(b)) if bin(k)[2:] not in b)
%o A261922 print([a(n) for n in range(99)]) # _Michael S. Branicky_, Sep 21 2023
%Y A261922 Similar to A261461.
%Y A261922 Cf. A007088, A030308, A062289, A126646, A262281.
%K A261922 nonn,base
%O A261922 0,3
%A A261922 _N. J. A. Sloane_, Sep 16 2015