$1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, ...$

This is the beginning of the sequence that counts the number of 1's in the binary representation of the positive integers.

Let $f(x)$ be the proportion of $2$ 's in the first $n$ terms of the sequence: for example, $f(20)=\frac{9}{20}.$

Find $\displaystyle \lim_{x\to\infty} f(x).$

$0$
$\frac{1}{e^{2}}$
$\frac{1}{4}$
$\frac{1}{e}$
$\infty$

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Although the number of 2's is large initially, they eventually get swamped by larger numbers. This is due to the way the sequence grows.

Consider the first seven terms: $1,1,2,1,2,2,3$ . The next term, the eighth is $1$ but then the next seven terms are just one more than each of the first seven: $2,2,3,2,3,3,4$ . The sixteenth term is $1$ then the process repeats. Those $2$ 's are going to become rare.

The number of $2$ 's is increasing polynomially as the number of digits increases exponentially, therefore the eventual proportion will tend to $\large 0$ .

In fact, every number will tend to zero, not just 2.