OFFSET
0,3
COMMENTS
Also the number of (3*n-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (3,3,...,3) with positive unit steps in all dimensions such that for each point (p_1,p_2,...,p_n) we have p_1<=p_2<=...<=p_n or p_1>=p_2>=...>=p_n.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..706
FORMULA
a(n) ~ 3^(3*n+1/2) / (Pi*n^4). - Vaclav Kotesovec, Jul 16 2014
MAPLE
a:= proc(n) option remember; `if`(n<5, [1, 1, 10, 53, 491][n+1],
((116013096898*n^6 -1106227006064*n^5 +3651730072724*n^4
-5019246600372*n^3 +2923780805838*n^2 -701199942904*n) *a(n-1)
+(-429126244301*n^6 +4283495440027*n^5 -14793057372915*n^4
+19089754215809*n^3 -168467698444*n^2 -17547244920336*n
+9564646580160) *a(n-2) +(24700698282*n^6 +2323122442728*n^5
-31157649402714*n^4 +153639646198428*n^3 -363480023453028*n^2
+415894667210784*n -184360926114960) *a(n-3) +(292122384552*n^6
-5522876986500*n^5 +42303228071580*n^4 -167574646102140*n^3
+360649174254588*n^2 -397826818736400*n +174796279534800) *a(n-4))/
(n*(3709935431*n^5 -22486109809*n^4 +4251368675*n^3 +135507711725*n^2
-75536091046*n -180596388856)))
end:
seq(a(n), n=0..30);
MATHEMATICA
b[nn__] := b[nn] = If[(lg = Length[{nn}]) < 2, 1, If[First[{nn}] == Last[{nn}], If[First[{nn}] == 0, 1, 2*b[First[{nn}]-1, Sequence @@ Rest[{nn}]]], If[First[{nn}] > 0, b[First[{nn}] - 1, Sequence @@ Rest[{nn}]], 0] + Sum[If[{nn}[[j]] > {nn}[[j-1]], b[Sequence @@ Table[ {nn}[[i]] - If[i == j, 1, 0], {i, 1, lg}]], 0], {j, 2, lg}]]];
a[n_] := If[n == 0, 1, b[2, Sequence @@ Table[3, {n-1}]]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 29 2017, after Alois P. Heinz (cf. A208615) *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Feb 29 2012
STATUS
approved