MathLabs

Problem 3

For positive integer kk, let f(k)f(k) be the number of integers in {k+1,…,2k}\{k+1,\ldots,2k\} whose binary expansion has exactly three 11s. Prove every positive integer mm occurs as f(k)f(k), and determine all mm for which exactly one kk has f(k)=mf(k)=m.
Step 4 of 5: Find consecutive binary numbers with two ones
In plain words

Find consecutive binary numbers with two ones

k−1=2n+1,k=2n+2(n≥2)k-1=2^n+1,\quad k=2^n+2\quad(n\ge2)
Detailed analysis

If a positive integer and its successor both have two 11s, the lower integer must have one high 11 and the final 11: k−1=2n+1k-1=2^n+1. The condition that kk also has two 11s requires n≥2n\ge2, giving k=2n+2k=2^n+2.