|
|
A190425
|
|
Number of one-sided prudent walks from (0,0) to (n,n), with floor(n/2)+n east steps, floor(n/2) west steps and n north steps.
|
|
1
|
|
|
1, 2, 12, 60, 700, 3780, 51744, 288288, 4247100, 24066900, 369881512, 2118412296, 33466634656, 193076738400, 3109838832000, 18037065225600, 294718130342460, 1716299700229620, 28355714001615000, 165657066009435000, 2761067350729888200, 16171965911417916600
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) ~ 2^(n + 1/2) * 3^(3*n/2 - (3 - (-1)^n)/4) / (Pi*n). - Vaclav Kotesovec, Oct 21 2023
|
|
MAPLE
|
a:= n-> b(0, iquo(n, 2), n, iquo(n, 2)+n):
b:= proc(i, w, no, e) option remember; `if`(-1 in {w, no, e}, 0,
`if`(no=0 and w=0 and e=0, 1, b(0, w, no-1, e)+
`if`(i<1, b(-1, w-1, no, e), 0)+`if`(i>-1, b(1, w, no, e-1), 0)))
end:
|
|
MATHEMATICA
|
a[n_] := b[0, Quotient[n, 2], n, Quotient[n, 2] + n]; b[i_, w_, no_, e_] := b[i, w, no, e] = If[MemberQ[{w, no, e}, -1], 0, If[no == 0 && w == 0 && e == 0, 1, b[0, w, no - 1, e] + If[i < 1, b[-1, w - 1, no, e], 0] + If[i > -1, b[1, w, no, e - 1], 0]]]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Oct 24 2016, after Alois P. Heinz *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|