login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A106542
a(n) = a(n-1) - 2*a(n-2) - 3*a(n-3) - ... - (n-1)*a(1), a(1) = a(2) = 3, a(3) = -3.
3
3, 3, -3, -18, -33, -15, 84, 261, 333, -138, -1557, -3315, -2436, 6153, 24009, 36390, 1431, -129639, -323292, -318819, 400725, 2149686, 3807795, 1476405, -10310388, -30697599, -37588047, 20103078, 186854271, 384871329, 260548788, -769001739, -2840006499
OFFSET
1,1
FORMULA
a(n) = a(n-1) - Sum_{k=2..n-1} k*a(n-k), with a(1) = a(2) = 3, a(3) = -3.
a(n) = 3*A106540(n).
From Colin Barker, Dec 04 2015: (Start)
a(n) = 3*a(n-1) - 5*a(n-2) + 2*a(n-3) for n>3.
G.f.: 3*x*(1-x)^2/(1-3*x+5*x^2-2*x^3). (End)
MATHEMATICA
LinearRecurrence[{3, -5, 2}, {3, 3, -3}, 40] (* G. C. Greubel, Sep 03 2021 *)
PROG
(PARI) a=vector(40); a[1]=3; for(n=2, #a, a[n]=a[n-1]-sum(k=2, n-1, k*a[n-k])); a[1..#a] \\ Colin Barker, Dec 04 2015
(Magma) I:=[3, 3, -3]; [n le 3 select I[n] else 3*Self(n-1) - 5*Self(n-2) + 2*Self(n-3): n in [1..41]]; // G. C. Greubel, Sep 03 2021
(Sage)
def A106542_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( 3*x*(1-x)^2/(1-3*x+5*x^2-2*x^3) ).list()
a=A106542_list(41); a[1:] # G. C. Greubel, Sep 03 2021
CROSSREFS
Sequence in context: A356388 A083562 A332860 * A342363 A229934 A239125
KEYWORD
easy,sign
AUTHOR
Alexandre Wajnberg, May 08 2005
STATUS
approved