%I #8 Jun 05 2017 16:07:44
%S 1,5,19,73,281,1083,4175,16097,62065,239307,922711,3557761,13717913,
%T 52893147,203943935,786361409,3032030689,11690820555,45077144455,
%U 173807214241,670161078089,2583988659867,9963272432111,38416111919777,148123788152017,571131629935179
%N Number of quinary sequences of length n such that no two consecutive terms have distance 2.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (4, 1, -6).
%F For n>0, a(n) = 4*a(n-1) + a(n-2) - 6*a(n-3), a(1)=5, a(2)=19, a(3)=73.
%F G.f.: (1 + x - 2*x^2 - 2*x^3)/(1 - 4*x - x^2 + 6*x^3).
%e For n=2 the a(2)=19=25-6 sequences contain every combination except these six: 02,20,13,31,24,42.
%t LinearRecurrence[{4, 1, -6}, {1, 5, 19, 73}, 40]
%o (Python)
%o def a(n):
%o .if n in [0,1,2,3]:
%o ..return [1,5,19,73][n]
%o .return 4*a(n-1)+a(n-2)-6*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