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).
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
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.
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..16383
- Scott R. Shannon, Image of the first 100000 terms.
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)
Comments