Arranging a $30$ character word with letters $x, y, z$ A word of length $30$ needs to be formed from the letters $x, y, z$ (repeatable) with the following conditions:


*

*$y$ cannot occur more than once consecutively

*$z$ cannot occur more than twice consecutively.
The question is how many such words are possible. 
Thanks,
Kiran

Consider num[L][l1][l2] = the number of words of length L starting with the two letters l1 and l2. 
Your problem is to find the sum of all num[30][l1][l2] for all possible choices of l1 and l2.
There is an induction formula to express num[L][l1][l2] in terms of num[L-1][m1][m2]
