A287815 Number of octonary sequences of length n such that no two consecutive terms have distance 7.
1, 8, 62, 482, 3746, 29114, 226274, 1758602, 13667858, 106226618, 825593474, 6416514026, 49869159026, 387583197338, 3012297335522, 23411580532682, 181954847741906, 1414153417389434, 10990803008177474, 85420541561578922, 663888608980117298, 5159743512230294618
Offset: 0
Examples
For n=2 the a(2) = 64 - 2 = 62 sequences contain every combination except these two: 07,70.
Links
- Index entries for linear recurrences with constant coefficients, signature (7, 6).
Crossrefs
Programs
-
Mathematica
LinearRecurrence[{7, 6}, {1, 8}, 40]
-
Python
def a(n): if n in [0, 1]: return [1, 8][n] return 7*a(n-1)+6*a(n-2)
Formula
a(n) = 7*a(n-1) + 6*a(n-2), a(0)=1, a(1)=8.
G.f.: (-1 - x)/(-1 + 7 x + 6 x^2).