A sequence of letters of the form $abcba$, where the expression is unchanged upon reversing order, is an example of a palindrome (of five letters).
(a) if a letter may appear more than twice, how many palindromes of five letters are there? of six letters
(b) Repeat part (a) under the condition that no letter appears more than twice