login
A130619
Let M(n) = {{n, 0, 1}, {1, 0, 0}, {0, 1, 0}}, then a(n) is the upper-right term of M(n)*M(n-1)*...*M(1).
0
0, 1, 2, 6, 25, 127, 768, 5401, 43335, 390783, 3913231, 43088876, 517457295, 6730858066, 94275101800, 1414643984295, 22641034606786, 384991863417162, 6931268185493211, 131716736558977795, 2634719723042973062
OFFSET
0,3
COMMENTS
Equivalently, a(n) is the middle-left term of M(1)*M(2)*...*M(n). - Jianing Song, Sep 24 2018
FORMULA
a(n) = n*a(n-1) + a(n-3) for n >= 3. - David A. Corneth, Sep 24 2018
E.g.f.: A'''(x), where A'''(x) = A(x)/(1 - x) + x + x^2, A(0) = A'(0) = A''(0) = 0.
MATHEMATICA
M[n_] := {{n, 0, 1}, {1, 0, 0}, {0, 1, 0}};
v[0] = {0, 0, 1};
v[n_] := v[n] = M[n].v[n - 1];
a = Table[v[n][[1]], {n, 0, 30}]
PROG
(PARI) a(n) = if(n<3, n, n*a(n-1) + a(n-3)) \\ Jianing Song, Sep 24 2018
(PARI) M(n) = [n, 0, 1; 1, 0, 0; 0, 1, 0];
lista(nn) = {v = [0, 0, 1]; for (n=0, nn, Mn = M(n); v = vector(3, k, sum(i=1, 3, Mn[i, k]*v[i])); print1(v[1], ", "); ); } \\ Michel Marcus, Sep 24 2018
(PARI) a=vector(50); a[1]=1; a[2]=2; a[3]=6; for(n=4, #a, a[n]=n*a[n-1]+a[n-3]); concat(0, a) \\ Altug Alkan, Sep 24 2018
CROSSREFS
Cf. A001053.
Sequence in context: A030899 A030907 A325576 * A330021 A181594 A030915
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Jun 18 2007
EXTENSIONS
Edited, new name, and offset corrected by Jianing Song, Sep 24 2018
STATUS
approved