A287838 Number of words of length n over the alphabet {0,1,...,10} such that no two consecutive terms have distance 8.
1, 11, 115, 1205, 12625, 132275, 1385875, 14520125, 152130625, 1593906875, 16699721875, 174966753125, 1833166140625, 19206495171875, 201230782421875, 2108340300078125, 22089556912890625, 231437270629296875, 2424820490857421875, 25405391261720703125
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..900
- Index entries for linear recurrences with constant coefficients, signature (10,5).
Crossrefs
Programs
-
Mathematica
LinearRecurrence[{10, 5}, {1, 11, 115}, 20]
-
PARI
Vec((1 + x) / (1 - 10*x - 5*x^2) + O(x^40)) \\ Colin Barker, Nov 25 2017
-
Python
def a(n): if n in [0,1,2]: return [1, 11, 115][n] return 10*a(n-1) + 5*a(n-2)
Formula
For n > 2, a(n) = 10*a(n-1) + 5*a(n-2), a(0)=1, a(1)=11, a(2)=115.
G.f.: (-1 - x)/(-1 + 10*x + 5*x^2).
a(n) = (((5-sqrt(30))^n*(-6+sqrt(30)) + (5+sqrt(30))^n*(6+sqrt(30)))) / (2*sqrt(30)). - Colin Barker, Nov 25 2017
Comments