OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-3,1,-1,3,-3,1).
FORMULA
O.g.f.: x*(4 - x - x^2 + 3*x^3 + x^4)/((1 - x)^3*(1 + x^4)).
E.g.f.: (exp(x)*x*(8 + 3*x) + (-1)^(1/4)*(sinh((-1)^(1/4)*x) - sin((-1)^(1/4)*x)))/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) - a(n-4) + 3*a(n-5) - 3*a(n-6) + a(n-7) for n > 6.
a(n) = (n*(5 + 3*n) - (1 - (-1)^n)*sin((n-1)*Pi/4))/2.
a(2*n) = A211014(n).
From Helmut Ruhland, Jan 29 2024: (Start)
For n > 1: a(n) - (2 * A368052(n+2) + A368052(n+3)) * 2 is periodic for n mod 8, i.e. a(n) = (2 * A368052(n+2) + A368052(n+3)) * 2 + f8(n) with
n mod 8 = 0 1 2 3 4 5 6 7
f8(n) = 0 0 -3 -2 -2 -2 1 0 (End)
EXAMPLE
Illustrations for n = 1..8:
_ _ _ _ _ _
|_| |_|_| |_ _ _|
|_ _| |_|_|_|
|_ _ _|
a(1) = 4 a(2) = 11 a(3) = 20
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_ _|_|_| |_ _|_|_ _| |_|_|_ _ _|_|
|_|_ _ _| |_|_ _ _|_| |_ _ _|_|_ _|
|_ _|_|_| |_ _|_|_ _| |_|_|_ _ _|_|
|_|_ _ _| |_|_ _ _|_| |_ _ _|_|_ _|
|_ _|_|_ _| |_|_|_ _ _|_|
|_ _ _|_|_ _|
a(4) = 34 a(5) = 50 a(6) = 69
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_|_|_ _ _|_|_| |_ _|_|_ _ _|_|_|
|_ _ _|_|_ _ _| |_|_ _ _|_|_ _ _|
|_|_|_ _ _|_|_| |_ _|_|_ _ _|_|_|
|_ _ _|_|_ _ _| |_|_ _ _|_|_ _ _|
|_|_|_ _ _|_|_| |_ _|_|_ _ _|_|_|
|_ _ _|_|_ _ _| |_|_ _ _|_|_ _ _|
|_|_|_ _ _|_|_| |_ _|_|_ _ _|_|_|
|_|_ _ _|_|_ _ _|
a(7) = 92 a(8) = 116
MATHEMATICA
LinearRecurrence[{3, -3, 1, -1, 3, -3, 1}, {0, 4, 11, 20, 34, 50, 69}, 50]
a[ n_] := (3*n^2 + 5*n)/2 - (-1)^Floor[n/4]*Boole[Mod[n, 4] == 3]; (* Michael Somos, Jan 25 2024 *)
PROG
(PARI) concat(0, Vec(x*(4 - x - x^2 + 3*x^3 + x^4)/((1 - x)^3*(1 + x^4)) + O(x^40))) \\ Felix Fröhlich, Jun 09 2021
(PARI) {a(n) = (3*n^2 + 5*n)/2 - (-1)^(n\4)*(n%4==3)}; /* Michael Somos, Jan 25 2024 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Stefano Spezia, Jun 08 2021
STATUS
approved