[go: up one dir, main page]

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

%I #11 Oct 20 2019 08:37:42

%S 1,11,105,1005,9621,92105,881753,8441329,80811789,773639469,

%T 7406320733,70903294113,678781988705,6498216958121,62209699634757,

%U 595555173609653,5701457600593525,54582044135967257,522532964509030377,5002390498942001761,47889630709552579709

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

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (10,-2,-21,10).

%F a(n) = 10*a(n-1) - 2*a(n-2) - 21*a(n-3) + 10*a(n-4), a(0)=1, a(1)=11, a(2)=105, a(3)=1005, a(4)=9621.

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

%t LinearRecurrence[{10, -2, -21, 10}, {1, 11, 105, 1005, 9621}, 20]

%o (Python)

%o def a(n):

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

%o ..return [1, 11, 105, 1005, 9621][n]

%o .return 10*a(n-1) - 2*a(n-2) - 21*a(n-3) + 10*a(n-4)

%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