OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (8,1,-14).
FORMULA
For n>2, a(n) = 8*a(n-1) + a(n-2) - 14*a(n-3), a(0)=1, a(1)=9, a(2)=71, a(3)=561.
G.f.: (1 + x - 2 x^2 - 2 x^3)/(1 - 8 x - x^2 + 14 x^3).
EXAMPLE
For n=2 the a(2) = 81 - 10 = 71 sequences contain every combination except these ten: 04,40,15,51,26,62,37,73,48,84.
MATHEMATICA
LinearRecurrence[{8, 1, -14}, {1, 9, 71, 561}, 40]
PROG
(Python)
def a(n):
if n in [0, 1, 2, 3]:
return [1, 9, 71, 561][n]
return 8*a(n-1)+a(n-2)-14*a(n-3)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 02 2017
STATUS
approved