Problem 3
For positive integer , let be the number of integers in whose binary expansion has exactly three s. Prove every positive integer occurs as , and determine all for which exactly one has .
Step 1 of 5: Track one step of the function
In plain words
Track one step of the function
Detailed analysis
Passing from to removes and adds and . The binary expansion of is that of followed by a zero, so these two contributions cancel. Therefore exactly when has three s, and otherwise .