A341798 a(n) is the starting position of the first occurrence of the binary reversal of n in the binary Champernowne word (A030190).
0, 1, 0, 1, 7, 2, 0, 4, 19, 6, 8, 1, 23, 2, 3, 15, 51, 18, 21, 5, 7, 26, 0, 11, 56, 22, 8, 1, 66, 2, 14, 46, 131, 50, 54, 17, 20, 63, 58, 4, 143, 6, 27, 25, 23, 77, 10, 41, 137, 55, 21, 34, 7, 28, 0, 11, 149, 65, 8, 1, 173, 13, 45, 125, 323, 130, 135, 49, 53
Offset: 0
Examples
For n = 4: - the binary reversal of 4 is "001", - the binary Champernowne word begins "0110111001011...", - the first occurrence of "001" in this word starts at position 7, - so a(4) = 7.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8192
- Rémy Sigrist, Perl program for A341798
Programs
-
Perl
See Links section.
-
Python
from itertools import count, islice def agen(): k, chap = 0, "0" for n in count(0): target = bin(n)[2:][::-1] while chap.find(target) == -1: k += 1; chap += bin(k)[2:] yield chap.find(target) print(list(islice(agen(), 70))) # Michael S. Branicky, Oct 06 2022
Comments