login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of (s(0), s(1), ..., s(n)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| <= 1 for i = 1,2,...,n, s(0) = 2, s(n) = 4.
2

%I #15 Oct 29 2019 12:17:05

%S 1,3,10,30,88,252,712,1992,5536,15312,42208,116064,318592,873408,

%T 2392192,6547584,17912320,48985344,133926400,366085632,1000548352,

%U 2734316544,7471826944,20416481280,55785005056,152419749888

%N Number of (s(0), s(1), ..., s(n)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| <= 1 for i = 1,2,...,n, s(0) = 2, s(n) = 4.

%C In general, a(n,m,j,k) = (2/m)*Sum_{r=1..m-1} Sin(j*r*Pi/m)*Sin(k*r*Pi/m)*(1+2*cos(Pi*r/m))^n) is the number of (s(0), s(1), ..., s(n)) such that 0 < s(i) < m and |s(i) -s(i-1)| <= 1 for i = 1,2,...,n, s(0) = j, s(n) = k.

%H Colin Barker, <a href="/A094306/b094306.txt">Table of n, a(n) for n = 2..1000</a>

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

%F a(n) = ((1-sqrt(3))^n + (1+sqrt(3))^n - 2^n)/4.

%F a(n) = (1/3)*Sum_{k=1..5} Sin(Pi*k/3)*Sin(2*Pi*k/3)*(1+2*cos(Pi*k/6))^n.

%F From _Colin Barker_, Oct 29 2019: (Start)

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

%F a(n) = 4*a(n-1) - 2*a(n-2) - 4*a(n-3) for n>4.

%F (End)

%t f[n_] := FullSimplify[ TrigToExp[(1/3)Sum[ Sin[Pi*k/3] Sin[2Pi*k/3] (1 + 2Cos[Pi*k/6])^n, {k, 1, 5}]]]; Table[ f[n], {n, 2, 27}] (* _Robert G. Wilson v_, Jun 18 2004 *)

%o (PARI) Vec(x^2*(1 - x) / ((1 - 2*x)*(1 - 2*x - 2*x^2)) + O(x^35)) \\ _Colin Barker_, Oct 29 2019

%K easy,nonn

%O 2,2

%A _Herbert Kociemba_, Jun 02 2004