Hello, ashkash!

I used Brute Force . . . and started making a list.

A sequence of letters of the form ABCBA 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?

With five letters, consider the first three letters.

3 different letters: .

2 different letters: .

. . Only one letter: .

With six letters, again consider the first three letters.

3 different letters: .

2 different letters: .

. . Only one letter: .

(b) Repeat part (a) under the condition that no letter appears more than twice.

Disregard answers in (a) marked with an asterisk