Problem

1997 AHSME Problem 30

For positive integers n, denote D(n) by the number of pairs of different adjacent digits in the binary (base two) representation of n. For example, D(3) = D(11_{2}) = 0, D(21) = D(10101_{2}) = 4, and D(97) = D(1100001_{2}) = 2. For how many positive integers less than or equal to 97 does D(n) = 2?

\textbf{(A)}\ 16\qquad\textbf{(B)}\ 20\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 35


Full credit goes to MAA for authoring these problems. These problems were taken on the AOPS website.


Show/Hide Problem Tags

Problem Tags: No tags

Want to contribute problems and receive full credit? Click here to add your problem!
Please report any issues to us in our Discord server
Go to previous contest problem (SHIFT + Left Arrow)