The first character can be any of the 4 characters: 4
The second character can be any of the 3 characters that are not the first character: 3
The third character can be any of the 3 characters that are not the second character: 3
…
The nth character can be any of the 3 characters that are not the $(n-1)$th character: 3
$= 4 \cdot 3^{n-1} $