OFFSET
0,2
EXAMPLE
a(7)=5 because P^7=[0,1,0;0,0,1;1,0,0], T^7=[1,2,2;2,3,2;2,4,3] and so P^7+T^7=[1,3,2;2,3,3;3,4,3].
MAPLE
with(linalg): a:=proc(n) local P, T, k: P[1]:=matrix(3, 3, [0, 1, 0, 0, 0, 1, 1, 0, 0]): T[1]:=matrix(3, 3, [0, 1, 0, 0, 0, 1, 1, 1, 0]):for k from 2 to n do P[k]:=multiply(P[1], P[k-1]): T[k]:=multiply(T[1], T[k-1]) od: evalm(P[n]+T[n])[1, 2]+evalm(P[n]+T[n])[1, 3] end: 0, seq(a(n), n=1..55);
MATHEMATICA
v[0] = {0, 1, 1}; w[0] = {0, 1, 1}; M3 = {{0, 1, 0}, {0, 0, 1}, {1, 0, 0}}; Mt = {{0, 1, 0}, {0, 0, 1}, {1, 1, 0}}; v[n_] := v[n] = M3.v[n - 1] w[n_] := w[n] = Mt.w[n - 1] a = Table[(w[n] + v[n])[[1]], {n, 0, 50}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Jun 17 2005
STATUS
approved