login
A078043
Expansion of (1 - x)/(1 + x - x^2 + 2*x^3).
4
1, -2, 3, -7, 14, -27, 55, -110, 219, -439, 878, -1755, 3511, -7022, 14043, -28087, 56174, -112347, 224695, -449390, 898779, -1797559, 3595118, -7190235, 14380471, -28760942, 57521883, -115043767, 230087534, -460175067, 920350135, -1840700270, 3681400539, -7362801079
OFFSET
0,2
COMMENTS
abs(a(n)) = A033129(n+1) - A033129(n). - Reinhard Zumkeller, Feb 22 2010
FORMULA
a(0)=1, a(1)=-2, a(2)=3, a(n) = -a(n-1) + a(n-2) - 2*a(n-3). - Harvey P. Dale, Feb 02 2012 [corrected by Wojciech Florek, Feb 26 2018]
a(n) = (1/21) * (-9*2^n*e^(i*n*Pi) + 9*cos((n*Pi)/3) - sqrt(3)*sin((n*Pi)/3)). - Harvey P. Dale, Feb 02 2012
a(n) = (1/7) * (6*(-2)^n + [1,-2,-3,-1,2,3](mod 6)) = A077972(n) - A077972(n-1). - Ralf Stephan, Aug 18 2013
a(n) = floor((6*(-2)^n+3)/7). - Tani Akinari, Oct 05 2014
MAPLE
f:= gfun:-rectoproc({a(0)=1, a(1)=-2, a(2)=3, a(n) = -a(n-1) + a(n-2) - 2*a(n-3)}, a(n), remember):
map(f, [$0..40]); # Robert Israel, Mar 28 2018
MATHEMATICA
CoefficientList[Series[(1-x)/(1+x-x^2+2x^3), {x, 0, 40}], x] (* or *) LinearRecurrence[{-1, 1, -2}, {1, -2, 3}, 40] (* Harvey P. Dale, Feb 02 2012 *)
PROG
(PARI) Vec((1-x)/(1+x-x^2+2*x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012
(PARI) a(n)=1/7*(6*(-2)^n+[1, -2, -3, -1, 2, 3][(n%6)+1]) /* Ralf Stephan, Aug 18 2013 */
(PARI) a(n)=(6*(-2)^n+3)\7 \\ Tani Akinari, Oct 05 2014
CROSSREFS
Sequence in context: A138651 A131300 A333342 * A294627 A293326 A308092
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved