OFFSET
0,3
COMMENTS
a(n) is equal to h_1(n) + h_2(n) as defined in A309038.
LINKS
Stefano Spezia, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-2,1).
FORMULA
O.g.f.: 2*x^2*(1 + x^2 + 2*x^4 - 2*x^5 + 2*x^6 - 2*x^7 + x^8)/((1 - x)^3*(1 + x)*(1 + x^2)).
E.g.f.: (1/24)*exp(-x)*(33 + 9*exp(2*x)*(7 - 2*x + 2*x^2) - 2*exp(x)*(48 + 12*x^2 + x^4) - 12*exp(x)*sin(x)).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - 2*a(n-5) + a(n-6) for n > 10.
a(n) = (1/8)*(21 - 12*n + 6*n^2 + 11*(-1)^n - 4*A056594(n+1) for n > 4, a(0) = 0, a(1) = 0, a(2) = 2, a(3) = 4, a(4) = 8.
Limit_{n->oo} a(n)/A000290(n) = 3/4.
EXAMPLE
Illustrations for n = 2..7:
__ __ __ __ __
|__|__ |__|__|__| |__|__|__|
|__| __|__|__ __|__|__ __
|__| |__| |__| | |
|__ __|
a(2) = 2 a(3) = 4 a(4) = 8
__ __ __ __ __ __ __ __ __ __ __
|__|__|__ __ __| |__|__|__| |__|__ |__|__|__| |__|__|__|
__|__|__ __ __|__|__ __|__| __|__|__ __|__|__
| | |__|__|__| |__| |__|__|__| |__| |__|__|__| |__|
| | __|__|__ __ __|__|__ __ __|__|__ __
|__| |__| |__| |__|__|__| |__|__ |__|__|__| |__|__|__|
|__| |__| __|__|__ __|__|__
|__| |__| |__| |__|
a(5) = 12 a(6) = 22 a(7) = 28
MAPLE
gf := (1/24)*exp(-x)*(33+9*exp(2*x)*(2*x^2-2*x+7)-2*exp(x)*(x^4+12*x^2+48)-12*exp(x)*sin(x)); ser := series(gf, x, 53):
seq(factorial(n)*coeff(ser, x, n), n = 0 .. 52)
MATHEMATICA
Join[{0, 0, 2, 4, 8}, Table[(1/8)*(21-12n+6n^2+11*(-1)^n-4*Sin[n*Pi/2]), {n, 5, 52}]]
PROG
(Magma) I:=[0, 0, 2, 4, 8, 12, 22, 28, 40, 48, 64]; [n le 11 select I[n] else 2*Self(n-1)-Self(n-2)+Self(n-4)-2*Self(n-5)+Self(n-6): n in [1..53]];
(PARI) concat([0, 0], Vec(2*x^2*(1+x^2+2*x^4-2*x^5+2*x^6-2*x^7+x^8)/((1-x)^3*(1+x)*(1+x^2))+O(x^53)))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Stefano Spezia, Sep 16 2019
STATUS
approved