OFFSET
1,2
COMMENTS
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)) counts (s(0), s(1), ..., s(2n)) such that 0 < s(i) < m and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = j, s(2n) = k.
Counts all paths of length (2*n+1), n >= 0, starting and ending at the initial node and ending at the nodes 1, 2, 3, 4 and 5 on the path graph P_7, see the Maple program. - Johannes W. Meijer, May 29 2010
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..1876
László Németh and László Szalay, Sequences Involving Square Zig-Zag Shapes, J. Int. Seq., Vol. 24 (2021), Article 21.5.2.
Index entries for linear recurrences with constant coefficients, signature (6,-10,4).
FORMULA
a(n) = (1/4)*Sum_{k=1..7} sin(Pi*k/8)*sin(3*Pi*k/8)*(2*cos(Pi*k/8))^(2n).
a(n) = 6*a(n-1) - 10*a(n-2) + 4*a(n-3).
G.f.: -x*(1 - 3*x + x^2)/((2*x - 1)*(2*x^2 - 4*x + 1)).
E.g.f.: (2*sinh(x)^2 + sinh(2*x) + sqrt(2)*exp(2*x)*sinh(sqrt(2)*x))/4. - Stefano Spezia, Jun 14 2023
MAPLE
with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=25; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[1, k], k=1..5); od: seq(a(2*n+1), n=0..nmax-1); # Johannes W. Meijer, May 29 2010
MATHEMATICA
f[n_] := FullSimplify[ TrigToExp[(1/4)Sum[ Sin[Pi*k/8]Sin[3Pi*k/8](2Cos[Pi*k/8])^(2n), {k, 1, 7}]]]; Table[ f[n], {n, 25}] (* Robert G. Wilson v, Jun 18 2004 *)
Rest@ CoefficientList[Series[-x (1 - 3 x + x^2)/((2 x - 1)*(2 x^2 - 4 x + 1)), {x, 0, 25}], x] (* Michael De Vlieger, Aug 04 2021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Herbert Kociemba, Jun 11 2004
STATUS
approved