A287829 Number of sequences over the alphabet {0,1,...,9} such that no two consecutive terms have distance 6.
1, 10, 92, 848, 7816, 72040, 663992, 6120008, 56408056, 519912520, 4792028792, 44168084168, 407096815096, 3752207504200, 34584061167992, 318760965520328, 2938016812018936, 27079673239211080, 249593092776937592, 2300497181470860488, 21203660818791619576
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (9,2).
Crossrefs
Programs
-
Mathematica
LinearRecurrence[{9, 2}, {1, 10}, 30]
-
Python
def a(n): if n in [0, 1]: return [1, 10][n] return 9*a(n-1)+2*a(n-2)
Formula
a(n) = 9*a(n-1) + 2*a(n-2), a(0)=1, a(1)=10.
G.f.: (-1 - x)/(-1 + 9*x + 2*x^2).
a(n) = ((1 - 11/sqrt(89))/2)*((9 - sqrt(89))/2)^n + ((1 + 11/sqrt(89))/2)*((9 + sqrt(89))/2)^n.
Comments