|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
G.f.: 2x(1+4x-4x^2)/((1+x)(1-x)^2)).
a(n) = a(n-1)+a(n-2)-a(n-3) = 2*A097062(n+2). (End)
|
|
MAPLE
|
|
|
MATHEMATICA
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|