|
|
A168230
|
|
a(n) = n + 2 - a(n-1) for n>1; a(1) = 0.
|
|
8
|
|
|
0, 4, 1, 5, 2, 6, 3, 7, 4, 8, 5, 9, 6, 10, 7, 11, 8, 12, 9, 13, 10, 14, 11, 15, 12, 16, 13, 17, 14, 18, 15, 19, 16, 20, 17, 21, 18, 22, 19, 23, 20, 24, 21, 25, 22, 26, 23, 27, 24, 28, 25, 29, 26, 30, 27, 31, 28, 32, 29, 33, 30, 34, 31, 35, 32, 36, 33, 37, 34, 38, 35, 39, 36, 40, 37
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Binomial transform of 0, 4 followed by a signed version of A005009.
Inverse binomial transform of A034007 without first and third term.
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x^2*(4 - 3*x)/((1+x)*(1-x)^2).
a(n) = (7*(-1)^n + 2*n + 5)/4.
a(n) = a(n-2) + 1 for n>2; a(1)=0, a(2)=4.
a(n) = a(n-1) + a(n-2) - a(n-3). - Colin Barker, Nov 08 2014
E.g.f.: (1/4)*(7 - 12*exp(x) + (5 + 2*x)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
Sum_{n>=2} (-1)^(n+1)/a(n) = 11/6. - Amiram Eldar, Feb 23 2023
|
|
EXAMPLE
|
a(2) = 2+2-a(1) = 4-0 = 4; a(3) = 3+2-a(2) = 5-4 = 1.
|
|
MATHEMATICA
|
CoefficientList[Series[x (4 - 3 x) / ((1 + x) (1 - x)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Sep 16 2013 *)
LinearRecurrence[{1, 1, -1}, {0, 4, 1}, 50] (* G. C. Greubel, Jul 16 2016 *)
nxt[{n_, a_}]:={n+1, n+3-a}; NestList[nxt, {1, 0}, 80][[All, 2]] (* Harvey P. Dale, May 28 2021 *)
|
|
PROG
|
(Magma) [ n eq 1 select 0 else -Self(n-1)+n+2: n in [1..75] ];
(PARI) Vec(x^2*(4-3*x)/((1+x)*(1-x)^2) + O(x^100)) \\ Colin Barker, Nov 08 2014
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Edited, three comments, four formulas, MAGMA program added by Klaus Brockhaus, Nov 22 2009
|
|
STATUS
|
approved
|
|
|
|