OFFSET
0,2
COMMENTS
LINKS
Index entries for linear recurrences with constant coefficients, signature (3, 1, -4, -2).
FORMULA
a(n) = 3*a(n-1) + a(n-2) - 4*a(n-3) - 2*a(n-4) for n >= 4.
EXAMPLE
a(6) = 414 = Sum([19, 21, 25, 47, 55, 59, 61, 127]) where the summands correspond to row 6 of A327992: [11001, 10101, 10011, 111101, 111011, 110111, 101111, 1111111].
MAPLE
gf := ((x - 1)*(x + 1)*(2*x^2 - 1))/(2*x^4 + 4*x^3 - x^2 - 3*x + 1):
ser := series(gf, x, 32): seq((coeff(ser, x, n)), n=0..29);
MATHEMATICA
LinearRecurrence[{3, 1, -4, -2}, {1, 3, 7, 20, 55}, 30]
PROG
(SageMath)
@cached_function
def a(n):
if n < 5: return [1, 3, 7, 20, 55][n]
return -2*a(n-4) - 4*a(n-3) + a(n-2) + 3*a(n-1)
print([a(n) for n in (0..29)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Oct 13 2019
STATUS
approved