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-3 of 3 results.

A381933 a(n) is the number of occurrences of n in A350311.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 2, 4, 4, 3, 4, 5, 4, 5, 6, 4, 5, 7, 6, 5, 8, 7, 6, 8, 7, 5, 9, 9, 6, 9, 10, 8, 10, 11, 7, 10, 11, 8, 8, 12, 10, 10, 13, 10, 10, 14, 13, 9, 15, 14, 11, 14, 14, 10, 14, 15, 9, 12, 16, 13, 13, 18, 14, 14, 18, 15, 11, 19, 18, 13, 18, 19, 15
Offset: 0

Views

Author

Rémy Sigrist, Mar 10 2025

Keywords

Examples

			The value 7 appears three times in A350311, hence a(7) = 3.
		

Crossrefs

Cf. A350311.

Programs

  • PARI
    \\ See Links section.

A350215 A048715, written in binary.

Original entry on oeis.org

0, 1, 10, 100, 1000, 1001, 10000, 10001, 10010, 100000, 100001, 100010, 100100, 1000000, 1000001, 1000010, 1000100, 1001000, 1001001, 10000000, 10000001, 10000010, 10000100, 10001000, 10001001, 10010000, 10010001, 10010010, 100000000, 100000001, 100000010
Offset: 0

Views

Author

A.H.M. Smeets, Dec 19 2021

Keywords

Comments

Narayana weighted representation of n (the top version).
a(n) equals binary representation of m, if and only if A350311(m) = n and for all k > m A350311(k) > n.

Crossrefs

Fibonacci representations: A014417 (Zeckendorf), A104326 (dual Zeckendorf).

Programs

  • Mathematica
    bin[n_] := FromDigits[IntegerDigits[n, 2]]; q[n_] := BitAnd[n, 6*n] == 0; bin /@ Select[Range[0, 250], q] (* Amiram Eldar, Jan 27 2022 *)
  • Python
    def c(b): return not "11" in b and not "101" in b
    def auptod(digits):
        return [int(b) for b in (bin(k)[2:] for k in range(2**digits)) if c(b)]
    print(auptod(9)) # Michael S. Branicky, Dec 20 2021

Formula

Regular expression 0|(1000*)*10*.

A350312 Narayana weighted representation of n (the bottom version). Also binary representation of numbers not containing 00 or 010 as a substring.

Original entry on oeis.org

0, 1, 10, 11, 101, 110, 111, 1011, 1101, 1110, 1111, 10110, 10111, 11011, 11101, 11110, 11111, 101101, 101110, 101111, 110110, 110111, 111011, 111101, 111110, 111111, 1011011, 1011101, 1011110, 1011111, 1101101, 1101110, 1101111, 1110110, 1110111, 1111011
Offset: 0

Views

Author

A.H.M. Smeets, Dec 24 2021

Keywords

Comments

a(n) equals binary representation of m, if and only if A350311(m) = n and for all k < m, A350311(k) < n.

Crossrefs

Cf. A000930, A048715, A350215 (top version), A350311.
Fibonacci representations: A014417 (Zeckendorf), A104326 (dual Zeckendorf).

Programs

  • Mathematica
    q[n_] := SequenceCount[IntegerDigits[n, 2], #] & /@ {{0, 0}, {0, 1, 0}} == {0, 0}; bin[n_] := FromDigits[IntegerDigits[n, 2]]; bin /@ Select[Range[0, 120], q] (* Amiram Eldar, Jan 27 2022 *)
  • Python
    # first method (as from definition)
    def A101(n):
        f0, f1, f2, r = 1, 1, 1, 0
        while n > 0:
            if n%2 == 1:
                r = r+f0
            n, f0, f1, f2 = n//2, f0+f2, f0, f1
        return r
    n, a = 0, 0
    while n < 36:
        if A101(a) == n:
            print(bin(a)[2:], end = ", ")
            n += 1
        a += 1
    
  • Python
    # second method (as from regular expression)
    def test(n):
        s, i, n1 = bin(n)[2:], 0, 2
        while i < len(s):
            if s[i] == "0":
                if n1 < 2:
                    return 0
                n1 = 0
            else:
                n1 += 1
            i += 1
        return 1
    n, a = 0, 0
    while n < 36:
        if test(a):
            print(bin(a)[2:], end = ", ")
            n += 1
        a += 1

Formula

Regular expression: 0|11*(0111*)*(0|01|011*)?.
Showing 1-3 of 3 results.