|
|
A258089
|
|
a(n) = n for n = 0..3; for n>3, a(n) = 4*a(n-1) + 3*a(n-2) + 2*a(n-3) + a(n-4).
|
|
0
|
|
|
0, 1, 2, 3, 20, 94, 444, 2101, 9944, 47061, 222722, 1054060, 4988472, 23608573, 111730550, 528778923, 2502512960, 11843458282, 56050660404, 265266821305, 1255408695956, 5941380026829, 28118330498198, 133073546286496, 629787345390192, 2980548061443481, 14105819705015690
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Weighted sum of the four previous terms.
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (8*x^3 + 2*x^2 -x)/(x^4 + 2*x^3 + 3*x^2 +4*x -1).
|
|
MATHEMATICA
|
LinearRecurrence[{4, 3, 2, 1}, {0, 1, 2, 3}, 27] (* or *)
RecurrenceTable[{a[n] == 4 a[n - 1] + 3 a[n - 2] + 2 a[n - 3] + a[n - 4], a[0] == 0, a[1] == 1, a[2] == 2, a[3] == 3}, a, {n, 0, 26}] (* or *)
a[n_] := 4 a[n - 1] + 3 a[n - 2] + 2 a[n - 3] + a[n - 4]; a[0] = 0; a[1] = 1; a[2] = 2; a[3] = 3; Array[a, 27, 0] (* or *)
CoefficientList[ Series[(8 x^3 + 2 x^2 - x)/(x^4 + 2 x^3 + 3 x^2 + 4 x - 1), {x, 0, 26}], x]
|
|
PROG
|
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; 1, 2, 3, 4]^n*[0, 1, 2, 3]~)[1] \\ Charles R Greathouse IV, May 19 2015
(Magma) [n le 4 select n-1 else 4*Self(n-1)+3*Self(n-2)+2*Self(n-3)+Self(n-4): n in [1..40]]; // Vincenzo Librandi, May 20 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|