I am looking for a number of ternary strings of length n, that dont contain consecutive zeroes. This was already asked, but I am NOT looking for reccurence relation. Instead, I found this formula, which produces the same result :
$$ \frac{\sqrt3 + 2}{2\sqrt3}(1+\sqrt3)^n + \frac{\sqrt3-2}{2\sqrt3}*(1-\sqrt3)^n $$
Can anyone explain me, how was this formula found out ?