|
|
A084247
|
|
a(n) = -a(n-1) + 2*a(n-2), a(0)=1, a(1)=2.
|
|
20
|
|
|
1, 2, 0, 4, -4, 12, -20, 44, -84, 172, -340, 684, -1364, 2732, -5460, 10924, -21844, 43692, -87380, 174764, -349524, 699052, -1398100, 2796204, -5592404, 11184812, -22369620, 44739244, -89478484, 178956972, -357913940, 715827884, -1431655764, 2863311532
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (4 - (-2)^n)/3.
G.f.: (1+3*x)/((1-x)*(1+2*x)).
E.g.f.: (4*exp(x) - exp(-2*x))/3.
|
|
MATHEMATICA
|
LinearRecurrence[{-1, 2}, {1, 2}, 40] (* Harvey P. Dale, Nov 05 2016 *)
|
|
PROG
|
(PARI) Vec((1+3*x)/((1-x)*(1+2*x)) + O(x^40)) \\ Michel Marcus, Feb 25 2016
(SageMath) [(4-(-2)^n)/3 for n in range(41)] # G. C. Greubel, Apr 24 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|