OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Ricardo Gómez Aíza, Trees with flowers: A catalog of integer partition and integer composition trees with their asymptotic analysis, arXiv:2402.16111 [math.CO], 2024. See p. 23.
Index entries for linear recurrences with constant coefficients, signature (4,-2,-4,-1).
FORMULA
G.f.: (1-x)/(1 - 2*x - x^2)^2.
a(n) = Sum_{k=0..n+1} A000129(k)*A001333(n+1-k). - Graeme McRae, Aug 03 2006 and Michel Marcus, Aug 01 2023
a(n) = 4*a(n-1) - 2*a(n-2) - 4*a(n-3) - a(n-4). - Vincenzo Librandi, Jun 20 2012
a(n) = ((n+2)/2)*A000129(n+1). - G. C. Greubel, May 25 2021
a(n) = ((n+2)/8)*((sqrt(2) + 2)*(1 + sqrt(2))^n - (sqrt(2) - 2)*(1 - sqrt(2))^n). - Peter Luschny, Jul 31 2023
MAPLE
with (combinat):seq(add(fibonacci(n, 2), k=0..n)/2, n=1..27); # Zerinvary Lajos, May 25 2008
MATHEMATICA
CoefficientList[Series[(1-x)/(1-2x-x^2)^2, {x, 0, 40}], x] (* Harvey P. Dale, Mar 22 2011 *)
LinearRecurrence[{4, -2, -4, -1}, {1, 3, 10, 30}, 40] (* Vincenzo Librandi, Jun 20 2012 *)
Table[(1/2)*(n+2)*Fibonacci[n+1, 2], {n, 0, 40}] (* G. C. Greubel, May 25 2021 *)
PROG
(Magma) I:=[1, 3, 10, 30]; [n le 4 select I[n] else 4*Self(n-1)-2*Self(n-2)-4*Self(n-3)-Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 20 2012
(PARI) my(x='x+O('x^40)); Vec((1-x)/(1-2*x-x^2)^2) \\ Altug Alkan, Sep 20 2018
(PARI) a(n) = my(w=quadgen(8)); (n/8)*((2+w)*(1+w)^n - (w-2)*(1-w)^n); \\ Michel Marcus, Jul 31 2023
(Sage) [(1/2)*(n+2)*lucas_number1(n+1, 2, -1) for n in (0..40)] # G. C. Greubel, May 25 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved