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.

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).

This page as a plain text file.
%I A341766 #25 Sep 16 2022 03:55:22
%S A341766 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,
%T A341766 11,18,6,7,1,192,91,38,85,3,45,20,73,163,67,2,22,40,3,45,49,95,43,139,
%U A341766 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
%N 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).
%C A341766 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).
%H A341766 Michael S. Branicky, <a href="/A341766/b341766.txt">Table of n, a(n) for n = 0..16383</a>
%H A341766 Scott R. Shannon, <a href="/A341766/a341766.png">Image of the first 100000 terms</a>.
%F A341766 From _Michael S. Branicky_, Sep 16 2022: (Start)
%F A341766 a(2^k-1) = 1, for k >= 1;
%F A341766 a(2^k) = (k+1)*2^k, for k >= 0. (End)
%e A341766 a(0) = 3 as '0' starts at position 1 and appears again at position 4.
%e A341766 a(1) = 1 as '1' starts at position 2 and appears again at position 3.
%e A341766 a(4) = 12 as '100' starts at position 7 and appears again at position 19.
%e A341766 a(7) = 1 as '111' starts at position 16 and appears again at position 17.
%e A341766 a(8) = 32 as '1000' starts at position 19 and appears again at position 51.
%o A341766 (Python)
%o A341766 def a(n):
%o A341766     b = s = bin(n)[2:]
%o A341766     while s.find(b, 1) < 0: n += 1; s += bin(n)[2:]
%o A341766     return s.find(b, 1)
%o A341766 print([a(n) for n in range(76)]) # _Michael S. Branicky_, Sep 16 2022
%Y A341766 Cf. A030190, A337227 (base 10), A296354, A296349, A296355.
%K A341766 nonn,base
%O A341766 0,1
%A A341766 _Scott R. Shannon_, Feb 19 2021