2021 National · Higher Secondary 7/12 বাং

Question 7

Combinatorics · Number theory BDMO 2021 National

A binary string is a word containing only 0s and 1s. In a binary string, a 1-run is a non-extendable substring containing only 1s. Given a positive integer nn, let B(n)B(n) be the number of 1-runs in the binary representation of nn. For example, B(107)=3B(107) = 3 since 107 in binary is 1101011 which has exactly three 1-runs. What is the following expression equal to?

B(1)+B(2)+B(3)+⋯+B(255)B(1) + B(2) + B(3) + \cdots + B(255)

Worked it out?

This paper's answer key isn't in yet, so mark it yourself.

Log in to save your progress.
Log in to report a mistake