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.

A296356 a(n) = A296354(n) - A296355(n).

Original entry on oeis.org

0, 0, 5, 3, 21, 19, 23, 11, 65, 53, 59, 72, 74, 81, 70, 31, 169, 182, 166, 176, 183, 148, 202, 188, 210, 202, 180, 228, 218, 216, 185, 79, 441, 345, 411, 467, 433, 458, 416, 475, 449, 489, 436, 461, 516, 374, 509, 462, 538, 487, 537, 505, 522, 503, 577, 560
Offset: 0

Views

Author

N. J. A. Sloane, Dec 14 2017, corrected and extended Dec 17 2017

Keywords

Comments

This is the binary "early-birdness" of n (cf. A116700, A296364).
Theorem: a(n) > 0 for all n > 1.
Proof. The claim is true for 2 <= n <= 7, so assume n >= 8, and let u = 1... denote the binary expansion of n. Let L denote the list of all binary vectors whose concatenation gives A076478.
To show a(n)>0 it is enough to exhibit a pair of successive binary vectors b, c in L whose concatenation contains a copy of u that begins in b and is such that b appears in L before u does. There are three cases.
(i) Suppose n is even, say u = 1x0. Take c = x00, and let b be the vector preceding c in L, so that b = y11, say. Then bc = y11x00 contains u.
(ii) Suppose n = 2^k-1, u = 1^k. Take b = 01^(k-1), c = 10^(k-1), so that bc = 0 1^k 0^(k-1).
(iii) Otherwise, n is an odd number whose binary expansion contains a 0, say u = 1^k 0x1. Take c = 0x10^k, and let b be the vector preceding c in L, so that b = y1^k, say, and bc = y1^k 0x10^k.
In each case we need to verify that b does appear in L before u, but we leave this easy verification to the reader. QED

Crossrefs

Extensions

More terms from Rémy Sigrist, Dec 19 2017

A341766 a(n) = difference between the starting positions of the first digit of the binary representation of n, where n starts at its natural position in the string, and the second occurrence of the same string in the binary Champernowne string (starting at 0) 011011100101110111100010011010... (cf. A030190).

Original entry on oeis.org

3, 1, 4, 1, 12, 4, 5, 1, 32, 13, 2, 9, 15, 5, 6, 1, 80, 36, 12, 31, 76, 8, 23, 21, 39, 16, 69, 11, 18, 6, 7, 1, 192, 91, 38, 85, 3, 45, 20, 73, 163, 67, 2, 22, 40, 3, 45, 49, 95, 43, 139, 37, 118, 31, 3, 25, 46, 19, 137, 13, 21, 7, 8, 1, 448, 218, 100, 211, 31, 136, 79, 197, 429, 25, 58, 123
Offset: 0

Views

Author

Scott R. Shannon, Feb 19 2021

Keywords

Comments

Consider the infinite string 011011100101110111100010011010... (cf. A030190) formed by the concatenation of all binary digits of all nonnegative numbers. From the position of the first digit of the binary representation of n, where n starts as its natural position in the string, find the number of digits one has to move forward to get to the start of the second occurrence of n. This is a(n).

Examples

			a(0) = 3 as '0' starts at position 1 and appears again at position 4.
a(1) = 1 as '1' starts at position 2 and appears again at position 3.
a(4) = 12 as '100' starts at position 7 and appears again at position 19.
a(7) = 1 as '111' starts at position 16 and appears again at position 17.
a(8) = 32 as '1000' starts at position 19 and appears again at position 51.
		

Crossrefs

Programs

  • Python
    def a(n):
        b = s = bin(n)[2:]
        while s.find(b, 1) < 0: n += 1; s += bin(n)[2:]
        return s.find(b, 1)
    print([a(n) for n in range(76)]) # Michael S. Branicky, Sep 16 2022

Formula

From Michael S. Branicky, Sep 16 2022: (Start)
a(2^k-1) = 1, for k >= 1;
a(2^k) = (k+1)*2^k, for k >= 0. (End)

A296354 Official position where binary expansion of n starts in the list of binary numbers in the binary Champernowne sequence A076478.

Original entry on oeis.org

0, 1, 6, 8, 22, 25, 28, 31, 66, 70, 74, 78, 82, 86, 90, 94, 178, 183, 188, 193, 198, 203, 208, 213, 218, 223, 228, 233, 238, 243, 248, 253, 450, 456, 462, 468, 474, 480, 486, 492, 498, 504, 510, 516, 522, 528, 534, 540, 546, 552, 558, 564, 570, 576, 582, 588
Offset: 0

Views

Author

N. J. A. Sloane, Dec 14 2017

Keywords

Comments

a(n) is the official position where the binary expansion of n appears. The binary expansion of n may also appear earlier, by accident, see A296355 and A296356.

Examples

			Here is the list A076478 broken up to show the successive binary numbers (the indexing starts at 0):
0,
1,
0,0,
0,1,
1,0,
1,1,
0,0,0,
0,0,1,
0,1,0,
0,1,1,
1,0,0,
1,0,1,
...
2 = 1,0 starts at position 6, so a(2) = 6.
4 = 1,0,0 starts at position 22, so a(4) = 22.
		

Crossrefs

Programs

  • PARI
    a(n) = my (w=#binary(n)); return (2 + 2^w*(w-2) + w*n) \\ Rémy Sigrist, Dec 15 2017

Formula

a(n) = A036799(A029837(n + 1) - 1) + A029837(n + 1) * n. - Rémy Sigrist, Dec 15 2017

Extensions

More terms from Rémy Sigrist, Dec 15 2017
Showing 1-3 of 3 results.