%I #3 Mar 12 2014 16:36:50
%S 1,4,12,20,136,392,1408,4544,15040,48896,159232,516608,1675264,
%T 5427200,17575936,56901632,184188928,596148224,1929379840,6244007936,
%U 20206845952,65392345088,211617316864,684814499840,2216119238656
%N Let M0 = {{2, 2, 0}, {1, 0, 1}, {0, 2, 2}}; M1 = {{1, 0, 1}, {2, 2, 0}, {0, 2, 2}}; M2 = {{2, 2, 0}, {0, 2, 2}, {1, 0, 1}}; M[n_] := M[n] = If[Mod[v[n][[1]], 3] == 0, M1, If[Mod[v[n][[2]], 3] == 0, M0, M2]] v[0] = {1, 1, 1}; M[0] = {{2, 2, 0}, {1, 0, 1}, {0, 2, 2}}; v[n_] := v[n] = M[n - 1].v[n - 1]. Then a(n) =v[n][[1]]
%t M0 = {{2, 2, 0}, {1, 0, 1}, {0, 2, 2}}; M1 = {{1, 0, 1}, {2, 2, 0}, {0, 2, 2}}; M2 = {{2, 2, 0}, {0, 2, 2}, {1, 0, 1}}; M[n_] := M[n] = If[Mod[v[n][[1]], 3] == 0, M1, If[Mod[v[n][[2]], 3] == 0, M0, M2]] v[0] = {1, 1, 1}; M[0] = {{2, 2, 0}, {1, 0, 1}, {0, 2, 2}}; v[n_] := v[n] = M[n - 1].v[n - 1] a0 = Table[v[n][[1]], {n, 0, 25}]
%K nonn
%O 0,2
%A _Roger L. Bagula_, Mar 03 2006