OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,-1).
FORMULA
a(n) = -1 * term (4,1) in the 4x4 matrix [0,0,1,0; 1,0,-1,0; 0,1,-1,0; 0,0,-1,1]^(n+3) - Alois P. Heinz, Jul 24 2008
a(n) = -A008937(-n-3). - Alois P. Heinz, Jul 24 2008
G.f.: 1 / (1 - 2*x^3 + x^4). - Michael Somos, Aug 19 2014
a(n) = -a(n-1) - a(n-2) + a(n-3) + 1 = 2*a(n-3) - a(n-4) for all n in Z. - Michael Somos, Aug 19 2014
a(n) - a(n-1) = A057597(n+2). (first differences). - R. J. Mathar, Oct 16 2017
EXAMPLE
G.f. = 1 + 2*x^3 - x^4 + 4*x^6 - 4*x^7 + x^8 + 8*x^9 - 12*x^10 + 6*x^11 + ...
MAPLE
a:= n-> -(<<0|0|1|0>, <1|0|-1|0>, <0|1|-1|0>, <0|0|-1|1>>^(n+3))[4, 1]:
seq(a(n), n=0..50); # Alois P. Heinz, Jul 24 2008
MATHEMATICA
a[n_] := -MatrixPower[{{0, 0, 1, 0}, {1, 0, -1, 0}, {0, 1, -1, 0}, {0, 0, -1, 1}}, n+3][[4, 1]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 14 2016, after Alois P. Heinz *)
LinearRecurrence[{0, 0, 2, -1}, {1, 0, 0, 2}, 50] (* Harvey P. Dale, Oct 25 2020 *)
PROG
(PARI) Vec((1-x)^(-1)/(1+x+x^2-x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012
(PARI) {a(n) = if( n<0, polcoeff( - x^4 / (1 - 2*x + x^4) + x * O(x^-n), -n), polcoeff( 1 / (1 - 2*x^3 + x^4) + x * O(x^n), n))}; /* Michael Somos, Aug 19 2014 */
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved