OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (5, -2, -3).
FORMULA
For n>3, a(n) = 5*a(n-1) - 2*a(n-2) - 3*a(n-3), a(1)=6, a(2)=26, a(3)=114.
G.f.: (1 + x - 2*x^2 - x^3)/(1 - 5*x + 2*x^2 + 3*x^3).
EXAMPLE
For n=2 the a(2)=26=36-10 sequences contain every combination except these ten: 01,10,12,21,23,32,34,43,45,54.
MATHEMATICA
LinearRecurrence[{5, -2, -3}, {1, 6, 26, 114}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2, 3]:
..return [1, 6, 26, 114][n]
.return 5*a(n-1)-2*a(n-2)-3*a(n-3)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
STATUS
approved