OFFSET
1,1
COMMENTS
First differences of A142717.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
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
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 29 2008
EXTENSIONS
Edited by R. J. Mathar, Oct 24 2008
STATUS
approved