A142954 a(n) = 2*n + 3 + 3*(-1)^n.
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
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Crossrefs
First differences of A214345.
Programs
-
GAP
List([1..55],n->2*n+3+3*(-1)^n); # Muniru A Asiru, Nov 01 2018
-
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
-
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 *)
-
Python
for n in range(1,50): print(2*n+3+3*(-1)**n, end=', ') # Stefano Spezia, Nov 01 2018
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)
Extensions
Edited by R. J. Mathar, Oct 24 2008
Comments