Recursive equation for binary palindromes

1.5k Views Asked by At

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$.

1

There are 1 best solutions below

0
On

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.