OFFSET
0,2
LINKS
FORMULA
a(n) = 6*a(n-1) + 3*a(n-2), a(0)=1, a(1)=7.
G.f.: (1 + x)/(1 - 6*x - 3*x^2).
EXAMPLE
For n=2 the a(2) = 49-4 = 45 sequences contain every combination except these four: 05, 50, 16, 61.
MATHEMATICA
LinearRecurrence[{6, 3}, {1, 7}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1]:
..return [1, 7][n]
.return 6*a(n-1)-3*a(n-2)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
STATUS
approved