login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number A(n,k) of lattice paths from {n}^k to {0}^k using steps that decrement one component by 1 such that for each point (p_1,p_2,...,p_k) we have abs(p_{i}-p_{i+1}) <= 1; square array A(n,k), n>=0, k>=0, read by antidiagonals.
24

%I #25 Jan 09 2019 14:50:08

%S 1,1,1,1,1,1,1,2,1,1,1,6,4,1,1,1,24,44,8,1,1,1,120,896,320,16,1,1,1,

%T 720,29392,33904,2328,32,1,1,1,5040,1413792,7453320,1281696,16936,64,

%U 1,1,1,40320,93770800,2940381648,1897242448,48447504,123208,128,1,1

%N Number A(n,k) of lattice paths from {n}^k to {0}^k using steps that decrement one component by 1 such that for each point (p_1,p_2,...,p_k) we have abs(p_{i}-p_{i+1}) <= 1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A227655/b227655.txt">Antidiagonals n = 0..18, flattened</a>

%e A(2,2) = 2^2 = 4:

%e (1,2) (0,1)

%e / \ / \

%e (2,2) (1,1) (0,0)

%e \ / \ /

%e (2,1) (1,0)

%e Square array A(n,k) begins:

%e 1, 1, 1, 1, 1, 1, ...

%e 1, 1, 2, 6, 24, 120, ...

%e 1, 1, 4, 44, 896, 29392, ...

%e 1, 1, 8, 320, 33904, 7453320, ...

%e 1, 1, 16, 2328, 1281696, 1897242448, ...

%e 1, 1, 32, 16936, 48447504, 482913033152, ...

%p b:= proc(l) option remember; `if`({l[]}={0}, 1, add(

%p `if`(l[i]=0 or i>1 and 1<abs(l[i-1]-l[i]+1) or

%p i<nops(l) and 1<abs(l[i+1]-l[i]+1), 0,

%p b(subsop(i=l[i]-1, l))), i=1..nops(l)))

%p end:

%p A:= (n, k)-> `if`(k<2, 1, b([n$k])):

%p seq(seq(A(n, d-n), n=0..d), d=0..10);

%t b[l_] := b[l] = If[Union[l] == {0}, 1, Sum[If[l[[i]] == 0 || i>1 && 1 < Abs[l[[i-1]] - l[[i]] + 1] || i<Length[l] && 1<Abs[l[[i+1]] - l[[i]] + 1], 0, b[ReplacePart[l, i -> l[[i]]-1]]], {i, 1, Length[l]}]]; a[n_, k_] := If[k<2, 1, b[Array[n&, k]]]; Table[Table[a[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* _Jean-François Alcover_, Dec 12 2013, translated from Maple *)

%Y Columns k=0+1, 2-10 give: A000012, A000079, A227665, A227666, A227667, A227668, A227669, A227670, A227671, A227672.

%Y Rows n=0-10 give: A000012, A000142, A227656, A227657, A227658, A227659, A227660, A227661, A227662, A227663, A227664.

%Y Main diagonal gives A227673.

%Y Cf. A262809, A263159, A318191.

%K nonn,tabl

%O 0,8

%A _Alois P. Heinz_, Jul 19 2013