login
A287807
Number of senary sequences of length n such that no two consecutive terms have distance 2.
0
1, 6, 28, 132, 624, 2952, 13968, 66096, 312768, 1480032, 7003584, 33141312, 156826368, 742110336, 3511703808, 16617560832, 78635142144, 372105487872, 1760822074368, 8332299518976, 39428864667648, 186579390892032, 882903157346304, 4177942598725632
OFFSET
0,2
FORMULA
For n>2, a(n) = 6*a(n-1) - 6*a(n-2), a(1)=6, a(2)=28.
G.f.: (1 - 2*x^2)/(1 - 6*x + 6*x^2).
EXAMPLE
For n=2 the a(2)=28=36-8 sequences contain every combination except these eight: 02,20,13,31,24,42,35,53.
MATHEMATICA
LinearRecurrence[{6, -6}, {1, 6, 28}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2]:
..return [1, 6, 28][n]
.return 6*a(n-1)-6*a(n-2)
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
STATUS
approved