A release-checked easy problem for training Combinations and Permutations.
Question
A palindrome $a_1a_2a_3a_4a_5$ is said to be $\textit{matchy}$ if $a_i = a_{i+1}$ for some $1 \leq i \leq 4$. Assuming each of $a_1,\dots, a_5$ can be any value $1$ to $k$ for some positive integer $k$, find the number of matchy palindromes when $k = 20$.
Practice focus
This Probability problem is tagged Combinations and Permutations. State the random variables and conditioning information explicitly, then check the result against boundary cases before opening hints or a solution.