OFFSET
0,2
COMMENTS
a(n) is the number of nonary sequences of length n such that no two consecutive terms have distance 6. - David Nacin, May 31 2017
LINKS
FORMULA
G.f.: (1 + x)/(1 - 8*x -3*x^2).
a(n) = 8*a(n-1) + 3*a(n-2) with n>1, a(0) = 1, a(1) = 9.
a(n) = ((1+t)*(4-t)^(n+1)+(-1+t)*(4+t)^(n+1))/(6*t), where t=sqrt(19). [Bruno Berselli, Feb 04 2015]
MATHEMATICA
RecurrenceTable[{a[0] == 1, a[1] == 9, a[n] == 8 a[n - 1] + 3 a[n - 2]}, a[n], {n, 0, 20}]
LinearRecurrence[{8, 3}, {1, 9}, 20] (* Harvey P. Dale, Feb 16 2024 *)
PROG
(Magma) [n le 1 select 9^n else 8*Self(n)+3*Self(n-1): n in [0..20]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Milan Janjic, Feb 04 2015
STATUS
approved