login
A142954
a(n) = 2*n + 3 + 3*(-1)^n.
3
2, 10, 6, 14, 10, 18, 14, 22, 18, 26, 22, 30, 26, 34, 30, 38, 34, 42, 38, 46, 42, 50, 46, 54, 50, 58, 54, 62, 58, 66, 62, 70, 66, 74, 70, 78, 74, 82, 78, 86, 82, 90, 86, 94, 90, 98, 94, 102, 98, 106, 102, 110, 106, 114, 110
OFFSET
1,1
COMMENTS
First differences of A142717.
FORMULA
a(2n+1) = A016825(n). a(2n) = A016825(n+1).
From R. J. Mathar, Oct 24 2008: (Start)
G.f.: 2*x*(1+4*x-3*x^2)/((1+x)*(1-x)^2). [corrected by Jason Yuen, Oct 01 2024]
a(n) = a(n-1)+a(n-2)-a(n-3) = 2*A097062(n+2). (End)
MAPLE
seq(2*n+3+3*(-1)^n, n=1..55); # Muniru A Asiru, Nov 01 2018
MATHEMATICA
Table[2 n + 3 + 3 (-1)^n, {n, 1, 60}] (* Vincenzo Librandi, Apr 03 2013 *)
LinearRecurrence[{1, 1, -1}, {2, 10, 6}, 60] (* Harvey P. Dale, Aug 20 2015 *)
PROG
(Magma) I:=[2, 10, 6]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..60]]; // Vincenzo Librandi, Apr 03 2013
(Python) for n in range(1, 50): print(2*n+3+3*(-1)**n, end=', ') # Stefano Spezia, Nov 01 2018
(GAP) List([1..55], n->2*n+3+3*(-1)^n); # Muniru A Asiru, Nov 01 2018
CROSSREFS
First differences of A214345.
Sequence in context: A105801 A086064 A076374 * A082225 A211365 A346498
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 29 2008
EXTENSIONS
Edited by R. J. Mathar, Oct 24 2008
STATUS
approved