A168457 a(n) = (10*n + 5*(-1)^n - 1)/2.
2, 12, 12, 22, 22, 32, 32, 42, 42, 52, 52, 62, 62, 72, 72, 82, 82, 92, 92, 102, 102, 112, 112, 122, 122, 132, 132, 142, 142, 152, 152, 162, 162, 172, 172, 182, 182, 192, 192, 202, 202, 212, 212, 222, 222, 232, 232, 242, 242, 252, 252, 262, 262, 272, 272, 282
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1 ).
Programs
-
Magma
[2+10*Floor(n/2): n in [1..70]]; // Vincenzo Librandi, Sep 19 2013
-
Mathematica
Table[5 n + 5 (-1)^n/2 - 1/2, {n, 60}] (* Bruno Berselli, Sep 16 2013 *) Table[2 + 10 Floor[n/2], {n, 70}] (* or *) CoefficientList[Series[2 (1 + 5 x - x^2)/((1 + x) (x - 1)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Sep 19 2013 *) LinearRecurrence[{1,1,-1},{2,12,12},80] (* Harvey P. Dale, Dec 27 2024 *)
Formula
a(n) = 10*n - a(n-1) - 6 for n>1, a(1)=2.
From Bruno Berselli, Sep 16 2013: (Start)
G.f.: 2*x*(1 + 5*x - x^2)/((1+x)*(1-x)^2).
a(n) = a(n-1) +a(n-2) -a(n-3). (End)
a(n) = 2 + 10*Floor(n/2). - Vincenzo Librandi, Sep 19 2013
E.g.f.: (1/2)*(5 - 4*exp(x) + (10*x - 1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 22 2016
Extensions
New definition by Bruno Berselli, Sep 16 2013