Problem

Source: 2024 Girls in Mathematics Tournament, Level A, Problem 1

Tags: combinatorics



A word is a sequence of capital letters of our alphabet (that is, there are 26 possible letters). A word is called palindrome if has at least two letters and is spelled the same forward and backward. For example, the words "ARARA" e "NOON" are palindromes, but the words "ESMERALDA" and "A" are not palindromes. We say that a word $x$ contains a word $y$ if there are consecutive letters of $x$ that together form the word $y$. For example, the word "ARARA" contains the word "RARA" and also the word "ARARA", but doesn't contain the word "ARRA". Compute the number of words of 14-letter that contain some palindrome.