A083321 a(n) = (-1)^n + (-2)^n - (-3)^n.
1, 0, -4, 18, -64, 210, -664, 2058, -6304, 19170, -58024, 175098, -527344, 1586130, -4766584, 14316138, -42981184, 129009090, -387158344, 1161737178, -3485735824, 10458256050, -31376865304, 94134790218, -282412759264, 847255055010, -2541798719464, 7625463267258
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (-6,-11,-6).
Crossrefs
Cf. A001550 (1^n + 2^n + 3^n).
Programs
-
Magma
[(-1)^n+(-2)^n-(-3)^n: n in [0..30]]; // Vincenzo Librandi, Sep 05 2011
-
Mathematica
a[n_]:=(-1)^n*(1+2^n-3^n); (* Vladimir Joseph Stephan Orlovsky, Dec 05 2008, corrected by M. F. Hasler, Apr 20 2020 *) LinearRecurrence[{-6,-11,-6},{1,0,-4},30] (* Harvey P. Dale, Mar 05 2022 *)
-
PARI
apply( A083321(n)=(-1)^n*(1+2^n-3^n), [0..33]) \\ M. F. Hasler, Apr 19 2020
Formula
G.f.: (1+6*x+7*x^2)/((1+x)*(1+2*x)*(1+3*x)).
E.g.f.: exp(-x)+exp(-2*x)-exp(-3*x).
a(n) = (-1)^(n-1)*(3^n - 2^n - 1) for n >= 0. - M. F. Hasler, Apr 19 2020