OFFSET
0,2
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2,-1,1).
FORMULA
From Bruno Berselli, May 03 2012: (Start)
G.f.: (1-x-x^2+3*x^3)/((1-x-x^2)*(1-x)^2).
a(n) = (3*A131269(n)-n-1)/2.
a(n) = 3*((1+sqrt(5))^(n+2)-(1-sqrt(5))^(n+2))/(2^(n+2)*sqrt(5))-2*(n+1). (End)
a(n) = 3*A000045(n+2)-2*(n+1). - R. J. Mathar, Mar 24 2018
EXAMPLE
a(4) = 14 = (1 + 1 + 7 + 4 + 1).
MAPLE
seq(add(3*binomial(floor((n+k)/2), k)-2, k=0..n), n=0..50); # Nathaniel Johnston, Jun 29 2011
MATHEMATICA
LinearRecurrence[{3, -2, -1, 1}, {1, 2, 3, 7}, 38] (* Bruno Berselli, May 03 2012 *)
PROG
(PARI) Vec((1-x-x^2+3*x^3)/((1-x-x^2)*(1-x)^2)+O(x^38)) \\ Bruno Berselli, May 03 2012
(Magma) /* By first comment: */ [&+[3*Binomial(n-Floor((k+1)/2), Floor(k/2))-2: k in [0..n]]: n in [0..37]]; // Bruno Berselli, May 03 2012
(Maxima) makelist(expand(3*((1+sqrt(5))^(n+2)-(1-sqrt(5))^(n+2))/(2^(n+2)*sqrt(5))-2*(n+1)), n, 0, 37); /* Bruno Berselli, May 03 2012 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Jun 27 2007
EXTENSIONS
Terms after a(9) from Nathaniel Johnston, Jun 29 2011
New definition from Bruno Berselli, May 03 2012
STATUS
approved