OFFSET
0,4
COMMENTS
a(n) is the number of 2-D walks with n steps of type {(1,-2), (1,-1), (1,1), or (1,2)} starting at (0,0), ending at (n,2), and not dropping below the x-axis.
LINKS
Robert Israel, Table of n, a(n) for n = 0..1667
FORMULA
a(n) = A185286(n,2). - Robert Israel, Dec 19 2017
EXAMPLE
There are 6 walks of length 3:
__
| | __
__| |_ __| |_ __ _
| | | |__|
_| _| _|
2+2-2=2 2+1-1=2 2-1+1=2
__
__ _ | |_ _
| | | __| __ |
_| |__| _| _| |__|
2-2+2=2 1+2-1=2 1-1+2=2
MAPLE
B := n -> LinearAlgebra:-ToeplitzMatrix([0, 1, 1, seq(0, k=0..n-2)], symmetric):
seq((B(n)^n)(1, 3), n=0..27);
# alternative:
T:= proc(n, k) option remember;
if k < 0 or k > 2*n then return 0 fi;
procname(n-1, k-2)+procname(n-1, k-1)+procname(n-1, k+1)+procname(n-1, k+2)
end proc:
T(0, 0):= 1:
seq(T(n, 2), n=0..40); # Robert Israel, Dec 19 2017
MATHEMATICA
b[n_] := ToeplitzMatrix[Join[{0, 1, 1}, ConstantArray[0, n-1]]];
Prepend[Table[MatrixPower[b[n], n][[1, 3]], {n, 20}], 0]
(* Andrey Zabolotskiy, Dec 19 2017 *)
PROG
(PARI)
Next(v)={vector(#v+2, i, if(i<3||i>#v-2, 0, v[i-2]+v[i-1]+v[i+1]+v[i+2]))}
my(v=vector(7, i, i==3)); for(n=1, 50, print1(v[5], ", "); v=Next(v)) \\ Andrew Howroyd, Dec 18 2017
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Feng Jishe, Dec 17 2017
STATUS
approved