OFFSET
0,2
COMMENTS
The number of n step walks (each step +-1 starting from 0) which are never more than k or less than -k is given by a(n,k) = 2^n/(k+1)*Sum_{r=1..k+1} (-1)^r*cos((Pi*(2*r-1))/(2*(k+1)))^n*cot((Pi*(1-2*r))/(4*(k+1))), n<>0 if k even. Here we have k=4. - Herbert Kociemba, Sep 22 2020
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,5,0,-5).
FORMULA
a(n) = A068913(4,n).
G.f.: (1+2*x-x^2-2*x^3+x^4)/(1-5*x^2+5*x^4).
a(n) = 5*a(n-2) - 5*a(n-4), a(0) = 1, a(1) = 2, a(2) = 4, a(3) = 8, a(4) = 16.
a(n) = (2^n/5)*Sum_{r=1..5} (-1)^r*cos(Pi*(2*r-1)/10)^n*cot(Pi*(1-2*r)/20), n>0. - Herbert Kociemba, Sep 22 2020
MATHEMATICA
nn=30; CoefficientList[Series[(1+x-x^2)^2/(1-5x^2+5x^4), {x, 0, nn}], x] (* Geoffrey Critzer, Jan 14 2014 *)
a[0, 4]=1; a[n_, k_]:=2^n/(k+1) Sum[(-1)^r Cos[(Pi (2r-1))/(2 (k+1))]^n Cot[(Pi (1-2r))/(4 (k+1))], {r, 1, k+1}]
Table[a[n, 4], {n, 0, 40}]//Round (* Herbert Kociemba, Sep 22 2020 *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Philippe Deléham, Mar 13 2013
STATUS
approved