OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,1,-1).
FORMULA
G.f.: 1/(1 - 4*x - x^2 + x^3).
a(n) = 4*a(n-1) + a(n-2) - a(n-3).
a(n) = Sum_{k=0..n} Sum_{j=0..k} binomial(n-k, j)*binomial(n-k, k-j)* 4^(n-2*k)*((1-sqrt(17))/2)^(k-j)*(1+sqrt(17))/2)^j.
MATHEMATICA
LinearRecurrence[{4, 1, -1}, {1, 4, 17}, 41]
PROG
(Magma) I:=[1, 4, 17]; [n le 3 select I[n] else 4*Self(n-1) +Self(n-2) -Self(n-3): n in [1..41]];
(SageMath)
@CachedFunction
def a(n): # a = A364705
if (n<3): return (1, 4, 17)[n]
else: return 4*a(n-1) +a(n-2) -a(n-3)
[a(n) for n in range(41)]
CROSSREFS
KEYWORD
nonn
AUTHOR
G. C. Greubel, Aug 04 2023
STATUS
approved