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.
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
Keywords
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.
Links
- Scott R. Shannon, Image of the first 100000 terms.
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
Comments