Let $A = \{a_1, a_2, ..., a_k\}$ be a finite alphabet.
a. Define, using structural induction, set of all palindromes of A.
b. Find the recurrent pattern which represents the number of all palindromes for length n, where $n = 1,2, \ldots $
Any hints please I am lost?
Palindromes with 1 digit (A) have "k" possibilities for that digit
Palindromes with 2 digits (AA) have "k" possibilities for those two digits
Palindromes with 3 digits (ABA) have "k" possibilities for the 1st and 3rd digits * "k" possibilities for the 2nd digit = $k^2$
Palindromes with 4 digits (ABBA) have "k" possibilities for the 1st and 4th digits * "k" possibilities for the 2nd and 3rd digits = $k^2$
Palindromes with 5 digits (ABCBA) have "k" possibilities for the 1st and 5th digits * "k" possibilities for the 2nd and 4th digits * "k" possibilities for the 3rd digit = $k^3$
…
Continuing the pattern we see that
1) palindromes with an odd number of "n" digits with have $k^{\frac{n+1}{2}}$ combinations, and
2) palindromes with an even number of "n" digits will have $k^{\frac{n}{2}}$ combinations