Problem:
How many sequences of five nonzero digits are such that the product of any two
consecutive digits is a perfect square?
$\textbf{(A) } 279 \qquad \textbf{(B) } 280 \qquad \textbf{(C) } 281 \qquad \textbf{(D) } 282 \qquad \textbf{(E) } 283$
Solution:
We perform casework on the first digit of the sequence.
If $a$ is a perfect square, meaning that it is one out of $1, 4, 9$, then the other $4$ elements in the sequence must also be perfect squares. So, there are $3^4$ possibilities for this case, but there are $3$ such cases, so there are $3 \cdot 3^4 = 3^5$ possibilities.
If $a=2$, then the other elements each must be one out of $2, 8$, so there are $2^4$ possibilities.
If $a$ is one out of $3, 5, 6, 7$, the other elements must be $a$ itself, so there is only $1$ possibility for each of these $4$ cases, giving us $4$ possibilities.
If $a=8$, then the other elements must be one out of $2, 8$, so there are $2^4$ possibilities.
Lastly, summing up all of these, we get that the total number of possibilities is $$3^5 + 2^4 + 4 + 2^4 = \boxed{\textbf{(A) } 279}$$
Comments
Post a Comment