OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,7,2,-4).
FORMULA
a(n) = a(n-1) + 7*a(n-2) + 2*a(n-3) - 4*a(n-4). - R. J. Mathar, Apr 04 2009
a(n) = ((-1)^n*Fibonacci(n+2) + 2^n*(5*Fibonacci(n+1) - 4*Fibonacci(n)))/3. - G. C. Greubel, Oct 07 2019
MAPLE
with(combinat); f:=fibonacci; seq(((-1)^n*f(n+2) + 2^n*(5*f(n+1) - 4*f(n)))/3, n=1..30); # G. C. Greubel, Oct 07 2019
MATHEMATICA
M = {{0, 1, 1, 1, 0, 1}, {1, 0, 1, 1, 1, 0}, {1, 1, 0, 0, 1, 1}, {1, 1, 0, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, {1, 0, 1, 0, 0, 0}}; v[1]={0, 1, 1, 2, 3, 5}; v[n_]:= v[n]= M.v[n-1]; Table[Floor[v[n][[1]]], {n, 50}]
LinearRecurrence[{1, 7, 2, -4}, {0, 9, 17, 72}, 30] (* Harvey P. Dale, Jul 29 2013 *)
With[{F=fibonacci}, Table[((-1)^n*F[n+2] + 2^n*(5*F[n+1]-4*F[n]))/3, {n, 30}]] (* G. C. Greubel, Oct 07 2019 *)
PROG
(PARI) vector(30, n, f=fibonacci; ((-1)^n*f(n+2) + 2^n*(5*f(n+1) - 4*f(n)))/3) \\ G. C. Greubel, Oct 07 2019
(Magma) F:=Fibonacci; [((-1)^n*F(n+2) + 2^n*(5*F(n+1) - 4*F(n)))/3: n in [1..30]]; // G. C. Greubel, Oct 07 2019
(Sage) f=fibonacci; [((-1)^n*f(n+2) + 2^n*(5*f(n+1) - 4*f(n)))/3 for n in (1..30)] # G. C. Greubel, Oct 07 2019
(GAP) F:=Fibonacci;; List([1..30], n-> ((-1)^n*F(n+2) + 2^n*(5*F(n+1) - 4*F(n)))/3); # G. C. Greubel, Oct 07 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Sep 01 2006
EXTENSIONS
New name (g.f. given by Mathar) by Joerg Arndt, Feb 06 2013
STATUS
approved