OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (6, 1, -10).
FORMULA
For n>3, a(n) = 6*a(n-1) + a(n-2) - 10*a(n-3), a(0)=1, a(1)=7, a(2)=41, a(3)=241.
G.f.: (1 + x - 2*x^2 - 2*x^3)/(1 - 6*x - x^2 + 10*x^3).
EXAMPLE
For n=2 the a(2) = 49-8 = 41 sequences contain every combination except these eight: 03, 30, 14, 41, 25, 52, 36, 63.
MATHEMATICA
LinearRecurrence[{6, 1, -10}, {1, 7, 41, 241}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2, 3]:
..return [1, 7, 41, 241][n]
.return 6*a(n-1)+a(n-2)-10*a(n-3)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
STATUS
approved