OFFSET
0,4
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..240
Index entries for linear recurrences with constant coefficients, signature (5, -9, 7, -2).
FORMULA
From Harvey P. Dale, May 12 2011: (Start)
a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4); a(0)=1, a(1)=1, a(2)=1, a(3)=2.
G.f.: 1/(1-2*x) + 1/(-1+x)^3 + 1/(-1+x)^2. (End)
a(n) = A331105(n,n) for n>0. - Alois P. Heinz, Jan 16 2020
MAPLE
seq(2^n-n*(n+1)/2, n=0..30); # Zerinvary Lajos, Jul 01 2007
MATHEMATICA
Table[2^n-n (n+1)/2, {n, 0, 50}] (* or *) LinearRecurrence[{5, -9, 7, -2}, {1, 1, 1, 2}, 50] (* Harvey P. Dale, May 12 2011 *)
PROG
(Magma) [2^n - n*(n+1)/2: n in [0..50]]; // Vincenzo Librandi, Apr 25 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved