HMMT-Feb 2017 comb, Problem 4

Sam spends his days walking around the following $2 \times 2$ grid of squares. \begin{center} \begin{tabular}{|l|l|} \hline 1 & 2 \\ \hline 4 & 3 \\ \hline \end{tabular} \end{center} Say that two squares are adjacent if they share a side. He starts at the square labeled 1 and every second walks to an adjacent square. How many paths can Sam take so that the sum of the numbers on every square he visits in his path is equal to 20 (not counting the square he started on)?

Solution: Note that on the first step, Sam can either step on 2 or 4 . On the second step, Sam can either step on 1 or 3 , regardless of whether he is on 2 or 4 . Now, for example, say that Sam takes 8 steps. His total sum will be $2+1+2+1+2+1+2+1+2 a$, where $a$ is the number of times that he decides to step on the larger number of his two choices. Solving gives $a=4$. As he took 8 steps, this gives him $\left(\begin{array}{l}8 \\ 4\end{array}\right)=70$ ways in this case. We can follow a similar approach by doing casework on the number of steps he takes. I will simply list them out here for brevity. For 8 steps, we get $\left(\begin{array}{l}8 \\ 4\end{array}\right)=70$. For 9 steps, we get $\left(\begin{array}{l}9 \\ 3\end{array}\right)=84$. For 12 steps, we get a contribution on $\left(\begin{array}{c}12 \\ 1\end{array}\right)=12$. For 13 steps, we get a contribution of $\left(\begin{array}{c}13 \\ 0\end{array}\right)=1$. Therefore, the final answer is $70+84+12+1=167$. $\fbox{167}$.

Answer: 167