OFFSET
0,2
LINKS
FORMULA
For n>2, a(n) = 9*a(n-1) - 10*a(n-2), a(0)=1, a(1)=9, a(2)=69.
G.f.: (1 - 2 x^2)/(1 - 9 x + 10 x^2).
For n>0, a(n)=(1/5)(3 - 18/sqrt(41))*((9 - sqrt(41))/2)^n + (1/5)(3 + 18/sqrt(41))*((9 + sqrt(41))/2)^n.
EXAMPLE
For n=2 the a(2) = 81 - 12 = 69 sequences contain every combination except these twelve: 03,30,14,41,25,52,36,63,47,74,58,85.
MATHEMATICA
LinearRecurrence[{9, -10}, {1, 9, 69}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2]:
..return [1, 9, 69][n]
.return 9*a(n-1)-10*a(n-2)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 02 2017
STATUS
approved