OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
a(n) = 2*(ceiling(2*(n+1)^2/3) - 1).
a(n) = 2*(A071619(n+1) - 1).
a(n) = 2*(1 + n^2 - 2*(n - 2)*floor((n - 1)/3) + 3*floor((n - 1)/3)^2) for n > 0.
a(n) = Sum_{k=1..n} A047410(k+1) for n > 0.
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5) for n > 4.
O.g.f.: 2*x*(2 + x + 2*x^2 - x^3)/((1 - x)^3*(1 + x + x^2)).
E.g.f.: 2*exp(-x/2)*(exp(3*x/2)*(6*x*(3 + x) - 1) + cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2))/9.
EXAMPLE
Illustrations for n = 1..8:
_ _ _ _ _ _
|_| | _| | _|_|
|_|_| |_| _|
|_|_|_|
a(1) = 4 a(2) = 10 a(3) = 20
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| _|_| | | _|_| _| | _|_| _|_|
|_| _|_| |_| _|_| | |_| _|_| _|
|_|_| _| |_|_| _|_| |_|_| _|_| |
|_ _|_|_| | _|_| _| | _|_| _|_|
|_|_ _|_|_| |_| _|_| _|
|_|_|_ _|_|_|
a(4) = 32 a(5) = 46 a(6) = 64
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| _|_| _|_| | | _|_| _|_| _|
|_| _|_| _|_| |_| _|_| _|_| |
|_|_| _|_| _| |_|_| _|_| _|_|
| _|_| _|_| | | _|_| _|_| _|
|_| _|_| _|_| |_| _|_| _|_| |
|_|_| _|_| _| |_|_| _|_| _|_|
|_ _|_|_ _|_|_| | _|_| _|_| _|
|_|_ _|_|_ _|_|_|
a(7) = 84 a(8) = 106
MATHEMATICA
Table[2(Ceiling[2(n+1)^2/3]-1), {n, 0, 49}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Stefano Spezia, Oct 17 2022
STATUS
approved