Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A168230
a(n) = n + 2 - a(n-1) for n>1; a(1) = 0.
9
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
OFFSET
1,2
COMMENTS
Interleaving of A001477 and A000027 without first three terms.
Binomial transform of 0, 4 followed by a signed version of A005009.
Inverse binomial transform of A034007 without first and third term.
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+1) - a(n) = A168309(n).
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
a=3; Table[a=n-a, {n, 3, 200}] (* Vladimir Joseph Stephan Orlovsky, Nov 22 2009 *)
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
Cf. A001477 (nonnegative integers), A000027 (positive integers), A168309 (repeat 4,-3), A005009 (7*2^n), A034007 (first differences of A045891).
Sequence in context: A131230 A076063 A035590 * A080414 A067061 A115210
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 21 2009
EXTENSIONS
Edited, three comments, four formulas, MAGMA program added by Klaus Brockhaus, Nov 22 2009
STATUS
approved