The question:
Find a recurrence for the number of n length ternary strings that contain "00", "11", or "22".
My answer:
$3(a_{n-2}) + 3(a_{n-1} - 1)$
Proof:
Cases:
______________00 (a_(n-2))
______________11 (a_(n-2))
______________22 (a_(n-2))
______________0 (a_(n-1) - 1)
______________1 (a_(n-1) - 1)
______________2 (a_(n-1) - 1) (Subtract the case in which it ends with 00, 11, or 22)
Let's see: $a_0 = 0$, $a_1 = 0$, $a_2 = 3$. No, that's not $3 a_0 + 3 (a_1 - 1)$.