%I #64 Feb 12 2022 17:58:27
%S 1,4,14,47,155,507,1652,5373,17460,56714,184183,598091,1942071,
%T 6305992,20475625,66484244,215873462,700937471,2275930827,7389902771,
%U 23994866364,77910846021,252974934692,821404463698,2667083556359
%N Number of (s(0), s(1), ..., s(2n+1)) such that 0 < s(i) < 7 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.
%C With interpolated zeros (0,0,0,1,0,4,0,14,...) counts walks of length n between the start and fourth nodes on P_6. - _Paul Barry_, Jan 26 2005
%C The Hankel transforms of this sequence or of this sequence with the first term omitted give 1, -2, 1, 1, -2, 1, ... . - _Wathek Chammam_, Nov 16 2011
%C Diagonal of the square array A216201. - _Philippe Deléham_, Mar 28 2013
%H G. C. Greubel, <a href="/A094789/b094789.txt">Table of n, a(n) for n = 1..1000</a>
%H W. Chammam, F. Marcellán and R. Sfaxi, <a href="http://dx.doi.org/10.1016/j.laa.2011.10.010">Orthogonal polynomials, Catalan numbers, and a general Hankel determinant evaluation</a>, Linear Algebra Appl. (2011), in press.
%H S. Morier-Genoud, V. Ovsienko and S. Tabachnikov, <a href="http://arxiv.org/abs/1008.3359">2-frieze patterns and the cluster structure of the space of polygons</a>, Annales de l'institut Fourier, 62 no. 3 (2012), 937-987; arXiv:1008.3359 [math.AG], 2010-2011. - _N. J. A. Sloane_, Dec 26 2012
%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 Roman Witula, Damian Slota and Adam Warzynski, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL9/Slota/slota57.html">Quasi-Fibonacci Numbers of the Seventh Order</a>, J. Integer Seq., 9 (2006), Article 06.4.3.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (5,-6,1).
%F a(n) = (2/7)*Sum_{k = 1..6} sin(Pi*k/7)*sin(4*Pi*k/7)*(2*cos(Pi*k/7))^(2n + 1).
%F a(n) = 5*a(n-1) - 6*a(n-2) + a(n-3).
%F G.f.: x*(x-1)/(-1 + 5*x - 6*x^2 + x^3). - Corrected by _Vincenzo Librandi_, Nov 10 2014
%F a(n) = 2^n*B(n; 1/2) = (1/7)*((c(1) - c(4))*(c(4))^(2n) + (c(2) - c(1))*(c(1))^(2n) + (c(4) - c(2))*(c(2))^(2n)), where c(j) := 2*cos(2*Pi*j/7). Here B(n; d), n in N, d in C denotes the respective quasi-Fibonacci number - see A121449 and Witula-Slota-Warzynski paper for details (see also A052975, A085810, A077998, A006054, A121442). - _Roman Witula_, Aug 09 2012
%F a(n+1) = A216201(n,n+2) = A216201(n,n+3). - _Philippe Deléham_, Mar 28 2013
%t f[n_] := FullSimplify[ TrigToExp[(2/7)Sum[ Sin[Pi*k/7]Sin[4Pi*k/7](2Cos[Pi*k/7])^(2n + 1), {k, 1, 6}]]]; Table[ f[n], {n, 25}] (* _Robert G. Wilson v_, Jun 18 2004 *)
%t LinearRecurrence[{5,-6,1}, {1,4,14}, 50] (* _Roman Witula_, Aug 09 2012 *)
%t CoefficientList[Series[(x - 1) / (- 1 + 5 x - 6 x^2 + x^3), {x, 0, 40}], x] (* _Vincenzo Librandi_, Nov 10 2014 *)
%o (Magma) I:=[1,4,14]; [n le 3 select I[n] else 5*Self(n-1)-6*Self(n-2)+Self(n-3): n in [1..45]]; // _Vincenzo Librandi_, Nov 10 2014
%o (PARI) Vec(x*(x-1)/(-1 + 5*x - 6*x^2 + x^3) + O(x^40)) \\ _Michel Marcus_, Nov 10 2014
%Y Cf. A094790, A080937, A005021.
%K nonn,easy
%O 1,2
%A _Herbert Kociemba_, Jun 11 2004