login
Number of senary sequences of length n such that no two consecutive terms have distance 1.
0

%I #8 Jun 05 2017 16:06:42

%S 1,6,26,114,500,2194,9628,42252,185422,813722,3571010,15671340,

%T 68773514,301811860,1324498252,5812546998,25508302906,111942925778,

%U 491260382084,2155891150146,9461106209228,41519967599596,182209952129086,799626506818554,3509152727035810

%N Number of senary sequences of length n such that no two consecutive terms have distance 1.

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

%F For n>3, a(n) = 5*a(n-1) - 2*a(n-2) - 3*a(n-3), a(1)=6, a(2)=26, a(3)=114.

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

%e For n=2 the a(2)=26=36-10 sequences contain every combination except these ten: 01,10,12,21,23,32,34,43,45,54.

%t LinearRecurrence[{5, -2, -3}, {1, 6, 26, 114}, 40]

%o (Python)

%o def a(n):

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

%o ..return [1, 6, 26, 114][n]

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

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

%K nonn,easy

%O 0,2

%A _David Nacin_, Jun 01 2017