login
Number of words of length n over the alphabet {0,1,...,10} such that no two consecutive terms have distance 4.
0

%I #11 Oct 20 2019 08:38:30

%S 1,11,107,1043,10169,99149,966719,9425675,91901945,896059709,

%T 8736735695,85184670011,830565128489,8098152315149,78958372642847,

%U 769857662314475,7506244118089817,73187166301583837,713587411625345903,6957599532298617755,67837787583138657929

%N Number of words of length n over the alphabet {0,1,...,10} such that no two consecutive terms have distance 4.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (10,-1,-14)

%F For n>3, a(n) = 10*a(n-1) - a(n-2) - 14*a(n-3), a(0)=1, a(1)=11, a(2)=107, a(3)=1043.

%F G.f.: (1 + x - 2 x^2 - 2 x^3)/(1 - 10 x + x^2 + 14 x^3).

%t LinearRecurrence[{10, -1, -14}, {1, 11, 107, 1043}, 20]

%o (Python)

%o def a(n):

%o .if n in [0,1,2,3]:

%o ..return [1, 11, 107, 1043][n]

%o .return 10*a(n-1) - a(n-2) - 14*a(n-3)

%Y Cf. A040000, A003945, A083318, A078057, A003946, A126358, A003946, A055099, A003947, A015448, A126473. A287804-A287819. A287825-A287839.

%K nonn,easy

%O 0,2

%A _David Nacin_, Jun 07 2017