OFFSET
1,3
MATHEMATICA
a[1] = {2, 2}; a[2] = {2, 1}; a[3] = {1, 2}; a[4] = {1, 1};
M[n_] := If[Mod[n, 3] == 0, {{ 0, 1}, {1, 2}}, If[Mod[n, 3] == 1, {{0, 1}, {1, 1}}, {{0, 1}, {1, 0}}]]
v[n_] := v[n] = MatrixPower[M[n], n].a[1 + Mod[n, 4]]
a1 = Table[v[n][[1]], {n, 1, 50}]
CROSSREFS
KEYWORD
nonn,uned,less
AUTHOR
Roger L. Bagula, Sep 17 2006
STATUS
approved