Problem: For a positive integer $n$, let $C(n)$ equal the number of pairs of consecutive 1's in the binary representation of $n$. For example, $C(183)=C\left(10110111_2\right)=3$. Compute $C(1)+C(2)+C(3)+\cdots+C(256)$.
Solution: First, notice that $C(256) = 0$ and so it suffices to count $C(0)+C(1) + C(2) + \dots + C(255) = 0$ (I added $C(0)$ to for reasons I will explain later). We can control this problem in an insane way. First, consider the $8$-digit binary string (that can have leading zeros) of each number in $\{ 1, \dots, 256 \}$. Notice that in the sum $C(0) + C(1)+C(2)+C(3)+\cdots+C(255)$, we can realize this as counting the number of pairs $11$ that show up in all binary strings of length $8$. Take a second to internalize that. As we sum from $1$ to $255$, we are going through each binary string and adding, to our sum, the number of times '$11