About Warm-ups Problems News

Exercise F

Posted 02/22/2015
Refresh the webpage if formulas are not shown correctly.
--------------------------
Previous    Next
--------------------------

A word `w` of length `n` over a given alphabet `A` is a sequence consisting of n letters chosen from the alphabet.

`a(n)` is the number of distinct words of length `n` over alphabet `A=\{a,b,c\}` such that no consecutive positions have the same letter.

For example, `a(3)=12` because we have words `\{aba,abc,aca,acb,bab,bac,bca,bcb,cab,cac,cba,cbc\}`.

Find `a(n)`.