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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

N. J. A. Sloane, Sep 16 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a261922 x = f a030308_tabf where
       f (cs:css) = if isInfixOf cs (a030308_row x)
                       then f css else foldr (\d v -> 2 * v + d) 0 cs
    -- Reinhard Zumkeller, Sep 17 2015
    
  • PARI
    bstr(n) = if (n==0, "0", my(s="", b=binary(n)); for (i=1, #b, s=concat(s, b[i])); s);
    a(n) = my(sn=btostr(n), k=0); while (#strsplit(sn, bstr(k)) != 1, k++); k; \\ Michel Marcus, Sep 20 2023
    
  • Python
    def a(n): b=bin(n)[2:]; return next(k for k in range(2**len(b)) if bin(k)[2:] not in b)
    print([a(n) for n in range(99)]) # Michael S. Branicky, Sep 21 2023

Formula

From Reinhard Zumkeller, Sep 17 2015: (Start)
a(A062289(n)) = A261461(A062289(n)).
a(A126646(n)) != A261461(A126646(n)). (End)

A262289 a(n) = smallest positive number, not a power of 2, that is not a substring of n in its binary representation.

Original entry on oeis.org

3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 5, 3, 3, 7, 6, 5, 5, 7, 7, 5, 9, 5, 5, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 7, 7, 9, 6, 5, 5, 5, 5, 7, 7, 7, 9, 5, 5, 9, 9, 5, 9, 5, 5, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 6, 3, 3, 7
Offset: 0

Views

Author

N. J. A. Sloane, Sep 19 2015

Keywords

Comments

Similar to A261461, but if the smallest missing number is a power of 2, ignore it and look at the next-smallest missing number.

Crossrefs

See A262281 for the "nonnegative" version.

Programs

  • Mathematica
    fQ[m_, n_] := Block[{g}, g[x_] := ToString@FromDigits@IntegerDigits[x, 2]; StringContainsQ[g@ n, g@ m]]; Table[k = 3; While[Or[fQ[k, n] && k < 2 n, IntegerQ@ Log[2, k]], k++]; k, {n, 0, 86}] (* Michael De Vlieger, Sep 21 2015 *)

Extensions

a(23)-a(86) from Hiroaki Yamanouchi, Sep 20 2015
Showing 1-2 of 2 results.