A287813 Number of octonary sequences of length n such that no two consecutive terms have distance 2.
1, 8, 52, 340, 2224, 14548, 95164, 622504, 4072036, 26636740, 174241072, 1139777284, 7455717772, 48770692552, 319027694548, 2086881784180, 13651089405616, 89296980486772, 584125595190556, 3820988224873576, 24994540788543364, 163498820845182820
Offset: 0
Examples
For n=2 the a(2) = 64 - 12 = 52 sequences contain every combination except these twelve: 02,20,13,31,24,42,35,53,46,64,57,75.
Links
- Index entries for linear recurrences with constant coefficients, signature (7, -3).
Crossrefs
Programs
-
Mathematica
LinearRecurrence[{7, -3}, {1, 8, 52}, 40]
-
Python
def a(n): if n in [0, 1, 2]: return [1, 8, 52][n] return 7*a(n-1)-3*a(n-2)
Formula
For n>2, a(n) = 7*a(n-1) - 3*a(n-2), a(0)=1, a(1)=8, a(2)=52.
G.f.: (1 + x - x^2)/(1 - 7 x + 3 x^2).