# Difference between revisions of "1997 AHSME Problems/Problem 30"

## Problem

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 $97$ to does $D(n) = 2$?

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