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.

Previous Showing 11-15 of 15 results.

A261794 a(n) is the smallest nonzero number that is not a substring of n in decimal representation.

Original entry on oeis.org

1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 01 2015

Keywords

Comments

A261795(n) = a(A261793(n)).

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a261794 x = f $ tail a031298_tabf where
       f (cs:css) = if isInfixOf cs (a031298_row x)
                       then f css else foldr (\d v -> 10 * v + d) 0 cs

Extensions

Name corrected by Álvar Ibeas, Sep 08 2020

A261923 Number of steps to reach 0, starting at n, and iteration the map x -> A261922(x).

Original entry on oeis.org

0, 1, 2, 1, 2, 2, 3, 1, 2, 2, 2, 3, 3, 3, 3, 1, 2, 2, 2, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 4, 3, 2, 3, 3, 2, 2, 2, 4, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Sep 17 2015

Keywords

Examples

			13 -> 4 -> 3 -> 0, which takes 3 steps to reach 0, so a(13)=3.
		

Crossrefs

Programs

  • Haskell
    a261923 n = fst $ until ((== 0) . snd)
                            (\(step, x) -> (step + 1, a261922 x)) (0, n)
    -- Reinhard Zumkeller, Sep 17 2015
    
  • PARI
    a(n) = if (n==0, 0, my(k=1, x=A261922(n)); while (x, x=A261922(x); k++); k); \\ Michel Marcus, Sep 20 2023
    
  • Python
    def f(n): b=bin(n)[2:]; return next(k for k in range(2**len(b)) if bin(k)[2:] not in b)
    def a(n): return 0 if n == 0 else 1 + a(f(n))
    print([a(n) for n in range(99)]) # Michael S. Branicky, Sep 21 2023

Formula

a(A262279(n)) = n. - Reinhard Zumkeller, Sep 17 2015

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

Original entry on oeis.org

3, 0, 3, 0, 3, 3, 5, 0, 3, 3, 3, 6, 5, 7, 5, 0, 3, 3, 3, 5, 3, 3, 7, 6, 5, 5, 7, 7, 5, 9, 5, 0, 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, 0, 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 17 2015

Keywords

Comments

Similar to A261922, but if the smallest missing number is a power of 2, ignore it and look at the next-smallest missing number.
This is like applying A261922 not to n itself but to n plus a very large power of 2. Suggested by considering A261416.

Examples

			For n = 13 = 1101_2, we can see 0, 11 (3), 101 (5), 110 (6), but not 111 (7), so a(13)=7.
		

Crossrefs

See A262289 for the "positive" version.

Extensions

a(23)-a(86) from Hiroaki Yamanouchi, Sep 20 2015

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

A301984 a(n) is the greatest positive number k such that the binary digits of any number in the interval 1..k appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

1, 2, 1, 2, 3, 3, 1, 2, 5, 6, 3, 4, 3, 3, 1, 2, 5, 6, 5, 6, 7, 7, 3, 4, 7, 7, 3, 4, 3, 3, 1, 2, 5, 6, 5, 6, 11, 11, 5, 6, 13, 14, 7, 8, 7, 7, 3, 4, 9, 10, 7, 8, 7, 7, 3, 4, 7, 7, 3, 4, 3, 3, 1, 2, 5, 6, 5, 6, 11, 11, 5, 6, 13, 14, 11, 12, 11, 11, 5, 6, 13, 14
Offset: 1

Views

Author

Rémy Sigrist, Mar 30 2018

Keywords

Comments

Equivalently, a(n) is the greatest positive number k such that A301983(n, k) = k.
Apparently, the k-th record value is A089633(k), and the first term with this value has index A048678(A089633(k)).

Examples

			The 13th row of A301983 is: 1, 2, 3, 5, 6, 7, 13; all numbers in the range 1..3 appear in this row, but the number 4 is missing; hence a(13) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); for (u=1, oo, if (!setsearch(s,u), return (u-1)))

Formula

a(n) <= A301977(n).
a(2*n) >= a(n).
a(2*n + 1) >= a(n) (with strict inequality if a(n) is even).
a(n) = 1 iff n is positive and belongs to A000225.
Previous Showing 11-15 of 15 results.