login
A287813
Number of octonary sequences of length n such that no two consecutive terms have distance 2.
0
1, 8, 52, 340, 2224, 14548, 95164, 622504, 4072036, 26636740, 174241072, 1139777284, 7455717772, 48770692552, 319027694548, 2086881784180, 13651089405616, 89296980486772, 584125595190556, 3820988224873576, 24994540788543364, 163498820845182820
OFFSET
0,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).
a(n) = A190972(n) + A190972(n+1) - A190972(n-1). - R. J. Mathar, Oct 20 2019
EXAMPLE
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.
MATHEMATICA
LinearRecurrence[{7, -3}, {1, 8, 52}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2]:
..return [1, 8, 52][n]
.return 7*a(n-1)-3*a(n-2)
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 02 2017
STATUS
approved