OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (9, -4, -21, 9, 5).
FORMULA
For n>5, a(n) = 9*a(n-1) - 4*a(n-2) - 21*a(n-3) + 9*a(n-4) + 5*a(n-5), a(0)=1, a(1)=10, a(2)=82, a(3)=674, a(4)=5540, a(5)=45538.
G.f.: (-1 - x + 4*x^2 + 3*x^3 - 3*x^4 - x^5)/(-1 + 9*x - 4*x^2 - 21*x^3 + 9*x^4 + 5*x^5).
MATHEMATICA
LinearRecurrence[{9, -4, -21, 9, 5}, {1, 10, 82, 674, 5540, 45538}, 40]
PROG
(Python)
def a(n):
if n in [0, 1, 2, 3, 4, 5]:
return [1, 10, 82, 674, 5540, 45538][n]
return 9*a(n-1) - 4*a(n-2) - 21*a(n-3) + 9*a(n-4) + 5*a(n-5)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 02 2017
STATUS
approved