[Math] Recursive equation for binary palindromes

binarycombinatoricsgenerating-functionspalindrome

Can someone help me determine the recursive equation for all binary strings that are palindromes? A binary string is a palindrome if it reads the same forward and backward. Examples of such palindromes are $01100110$ and $101101$.

Best Answer

Does it have to be recursive? $$a_n=2^{\left\lceil n/2\right\rceil}$$

I suppose you could say $a_n=2a_{n-2}$, by putting the palindrome of length $n-2$ in the middle, and either putting 1's or 0's on either end.

Related Question