login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A261461 a(n) is the smallest nonzero number that is not a substring of n in its binary representation. 16

%I #34 Feb 26 2023 16:47:28

%S 1,2,3,2,3,3,4,2,3,3,3,4,5,4,4,2,3,3,3,5,3,3,4,4,5,5,4,4,5,4,4,2,3,3,

%T 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,2,3,3,3,5,

%U 3,3,5,5,3,3,3,6,5,7,5,5,3,3,3,6,3,3

%N a(n) is the smallest nonzero number that is not a substring of n in its binary representation.

%C A261018(n) = a(A260273(n)).

%C Is a(n) = A091460(n) for n>1? - _R. J. Mathar_, Sep 02 2015. The lowest counterexample occurs at a(121) = 5 < 6 = A091460(121). - _Álvar Ibeas_, Sep 08 2020

%C a(A062289(n))=A261922(A062289(n)); a(A126646(n))!=A261922(A126646(n)). - _Reinhard Zumkeller_, Sep 17 2015

%H Reinhard Zumkeller, <a href="/A261461/b261461.txt">Table of n, a(n) for n = 0..10000</a>

%H David Consiglio, Jr., <a href="/A261461/a261461.txt">Python Program</a>

%F a(n) = A144016(n) + 1 for any n > 0. - _Rémy Sigrist_, Mar 10 2018

%t fQ[m_, n_] := Block[{g}, g[x_] := ToString@ FromDigits@ IntegerDigits[x, 2]; StringContainsQ[g@ n, g@ m]]; Table[k = 1; While[fQ[k, n] && k < n, k++]; k, {n, 85}] (* _Michael De Vlieger_, Sep 21 2015 *)

%o (Haskell)

%o import Data.List (isInfixOf)

%o a261461 x = f $ tail a030308_tabf where

%o f (cs:css) = if isInfixOf cs (a030308_row x)

%o then f css else foldr (\d v -> 2 * v + d) 0 cs

%o (Python)

%o from itertools import count

%o def a(n):

%o b, k = bin(n)[2:], 1

%o return next(k for k in count(1) if bin(k)[2:] not in b)

%o print([a(n) for n in range(86)]) # _Michael S. Branicky_, Feb 26 2023

%Y Cf. A007088, A030308, A260273, A261018; record values and where they occur: A261466, A261467.

%Y See A261922 for a variant.

%Y Cf. A062289, A144016, A261922, A126646.

%K nonn,base

%O 0,2

%A _Reinhard Zumkeller_, Aug 30 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 13:40 EDT 2024. Contains 371792 sequences. (Running on oeis4.)