Question 30
For positive integers $n,$ denote by $D(n)$ 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 $n$ less than or equal to $97$ does $D(n)=2?$