login
A168269
a(n) = 2*n - (-1)^n.
3
3, 3, 7, 7, 11, 11, 15, 15, 19, 19, 23, 23, 27, 27, 31, 31, 35, 35, 39, 39, 43, 43, 47, 47, 51, 51, 55, 55, 59, 59, 63, 63, 67, 67, 71, 71, 75, 75, 79, 79, 83, 83, 87, 87, 91, 91, 95, 95, 99, 99, 103, 103, 107, 107, 111, 111, 115, 115, 119, 119, 123, 123, 127, 127, 131, 131
OFFSET
1,1
FORMULA
G.f.: x*(3 + x^2)/( (1+x)*(x-1)^2 ). - R. J. Mathar, Jan 05 2011
a(n) = a(n-1) +a(n-2) -a(n-3). - Vincenzo Librandi, Sep 16 2013
E.g.f.: (-1 + exp(x) + 2*x*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
MATHEMATICA
CoefficientList[Series[(3 + x^2)/((1 + x) (x - 1)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Sep 16 2013 *)
LinearRecurrence[{1, 1, -1}, {3, 3, 7}, 50] (* G. C. Greubel, Jul 16 2016 *)
PROG
(Magma) [2*n-(-1)^n: n in [1..70]]; // Vincenzo Librandi, Sep 16 2013
(PARI) a(n)=2*n-(-1)^n \\ Charles R Greathouse IV, Jul 16 2016
CROSSREFS
Cf. A004767.
Sequence in context: A302446 A109579 A109580 * A326936 A336416 A128508
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 22 2009
EXTENSIONS
New definition by R. J. Mathar, Jan 05 2011
STATUS
approved