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

%I #19 Feb 12 2022 17:51:20

%S 1,4,14,48,165,571,1988,6953,24396,85786,302104,1064945,3756519,

%T 13256712,46796545,165225380,583440086,2060408640,7276716445,

%U 25700060995,90770326604,320598127113,1132355884236,3999522488002

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

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

%H Michael De Vlieger, <a href="/A094827/b094827.txt">Table of n, a(n) for n = 1..1825</a>

%H László Németh and László Szalay, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL24/Nemeth/nemeth8.html">Sequences Involving Square Zig-Zag Shapes</a>, J. Int. Seq., Vol. 24 (2021), Article 21.5.2.

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

%F a(n) = (2/9)*Sum_{r=1..8} sin(r*Pi/9)*sin(4*r*Pi/9)*(2*cos(r*Pi/9))^(2*n+1).

%F a(n) = 7*a(n-1) - 15*a(n-2) + 10*a(n-3) - a(n-4).

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

%F 3*a(n) = A094829(n+2) -2*A094829(n+1) -2*A094829(n)-1. - _R. J. Mathar_, Nov 14 2019

%t LinearRecurrence[{7,-15,10,-1},{1,4,14,48},30] (* _Harvey P. Dale_, Jul 09 2020 *)

%K nonn,easy

%O 1,2

%A _Herbert Kociemba_, Jun 13 2004