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

A352245 a(0) = 1; for n >= 1, a(n) = the decimal value of the binary number of the index of where n first appears in the concatenation of all previous binary terms. If the binary value of n has not previously appeared then a(n) = 0.

Original entry on oeis.org

1, 1, 0, 1, 0, 2, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 8, 0, 0, 6, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 20, 0, 8, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, 0, 0, 0, 0, 56, 0, 26, 1, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 47, 20, 0, 71, 8, 84, 0, 110, 57, 0, 0, 0, 0, 0, 0, 0, 27, 6, 79, 155, 4, 2, 0, 0, 0, 0, 0, 0, 134
Offset: 0

Views

Author

Scott R. Shannon, Mar 09 2022

Keywords

Comments

In the first 250000 terms the longest run of consecutive 0 terms is seven, the first occurrence of which starts at a(43). It is unknown if longer runs exists. See the companion sequence A352246 for the indices where a(n) = 0.

Examples

			a(1) = 1 as the binary string concatenation up to a(0) = '1', and the binary value of 1 is '1' which appears at index 1 in the string.
a(2) = 0 as the binary string concatenation up to a(1) = '11', while the binary value of 2 is '10' which does not appear in the string.
a(3) = 1 as the binary string concatenation up to a(2) = '110', and the binary value of 3 is '11' which appears at index 1 in the string.
a(5) = 2 as the binary string concatenation up to a(4) = '11010', and the binary value of 5 is '101' which appears at index 2 in the string.
a(17) = 8 as the binary string concatenation up to a(16) = '1101010100010001000', and the binary value of 17 is '10001' which appears at index 8 in the string.
		

Crossrefs

Cf. A352246, A342303 (from end), A351753, A341766.

Programs

  • Python
    from itertools import count, islice
    def agen():
        b = "1"
        yield 1
        for k in count(1):
            bk = bin(k)[2:]
            idx = b.find(bk) + 1
            yield idx
            b += bin(idx)[2:]
    print(list(islice(agen(), 93))) # Michael S. Branicky, Mar 18 2022
Showing 1-1 of 1 results.