OFFSET
1,4
MATHEMATICA
M1 = {{-n, 1, 0}, {0, 1, 0}, {0, 0, 1}};
M2 = {{1, 0, 0}, {n, -n, 1}, {0, 0, 1}};
M3 = {{1, 0, 0}, {0, 1, 0}, {0, n, -n}};
M[n_] := If[Mod[n, 3] == 1, M1, If[Mod[n, 3] == 2, M2, M3]]
v[1] = {1, 0, 0}
v[n_] := v[n] = M[n].v[n - 1]
a1 = Table[v[n][[1]], {n, 1, 50}]
CROSSREFS
KEYWORD
uned,sign,easy,less
AUTHOR
Roger L. Bagula and Gary W. Adamson, Oct 03 2006
STATUS
approved