OFFSET
0,6
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..500
Index entries for linear recurrences with constant coefficients, signature (-3,-2,1).
FORMULA
From R. J. Mathar, Jan 21 2009: (Start)
a(n) = -3*a(n-1) - 2*a(n-2) + a(n-3).
G.f.: x*(1 +2*x)/(1 +3*x +2*x^2 -x^3). (End)
MATHEMATICA
(* First program *)
b[n_]:= b[n]= If[n==0, 0, If[n<3, 1, b[n-2] +b[n-3]]];
a[n_]:= Sum[(-1)^m*Binomial[n, m]*b[n-m], {m, 0, n}];
Table[a[n], {n, 0, 50}]
(* Second program *)
LinearRecurrence[{-3, -2, 1}, {0, 1, -1}, 51] (* G. C. Greubel, Mar 27 2021 *)
PROG
(Magma) I:=[0, 1, 1]; [n le 3 select I[n] else -3*Self(n-1) -2*Self(n-2) +Self(n-3): n in [1..51]]; // G. C. Greubel, Mar 27 2021
(Sage)
@CachedFunction
def A000931(n): return 1 if n==0 else sum( binomial(k, n-2*k-3) for k in (0..floor((n-3)/2)))
[A144413(n) for n in (0..50)] # G. C. Greubel, Mar 27 2021
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula and Gary W. Adamson, Sep 30 2008
EXTENSIONS
Terms a(30) onward added and edited by G. C. Greubel, Mar 27 2021
STATUS
approved