This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A318191 #27 Oct 22 2023 11:35:51 %S A318191 1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,6,12,4,1,1,1,24,180,72,8,1,1,1,120, %T A318191 4680,5400,432,16,1,1,1,720,187200,914400,162000,2592,32,1,1,1,5040, %U A318191 10634400,296438400,178660800,4860000,15552,64,1,1,1,40320,813664800,162273628800,469551168000,34907788800,145800000,93312,128,1,1 %N A318191 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 we have abs(p_{i}-p_{(i mod k)+1}) <= 1 and the first component used is p_1; square array A(n,k), n>=0, k>=0, read by antidiagonals. %H A318191 Alois P. Heinz, <a href="/A318191/b318191.txt">Antidiagonals n = 0..20, flattened</a> %e A318191 A(2,2) = 2^2 = 4: %e A318191 (0,1) %e A318191 / \ %e A318191 (2,2)-(1,2)-(1,1) (0,0) %e A318191 \ / %e A318191 (1,0) %e A318191 Square array A(n,k) begins: %e A318191 1, 1, 1, 1, 1, 1, 1, ... %e A318191 1, 1, 1, 2, 6, 24, 120, ... %e A318191 1, 1, 2, 12, 180, 4680, 187200, ... %e A318191 1, 1, 4, 72, 5400, 914400, 296438400, ... %e A318191 1, 1, 8, 432, 162000, 178660800, 469551168000, ... %e A318191 1, 1, 16, 2592, 4860000, 34907788800, 743761386086400, ... %e A318191 1, 1, 32, 15552, 145800000, 6820487308800, 1178106009360998400, ... %p A318191 b:= proc(l) option remember; (n-> `if`(n<2 or max(l[])=0, 1, %p A318191 add(`if`(l[i]=0 or 1<abs(l[`if`(i=1, 0, i)-1]-l[i]+1) %p A318191 or 1<abs(l[`if`(i=n, 0, i)+1]-l[i]+1), 0, %p A318191 b(subsop(i=l[i]-1, l))), i=1..n)))(nops(l)) %p A318191 end: %p A318191 A:= (n, k)-> `if`(k<2 or n=0, 1, b([n-1, n$k-1])): %p A318191 seq(seq(A(n, d-n), n=0..d), d=0..10); %t A318191 b[l_] := b[l] = With[{n = Length[l]}, If[n < 2 || Max[l ] == 0, 1, Sum[If[ l[[i]] == 0 ||1 < Abs[l[[If[i == 1, 0, i] - 1]] - l[[i]] + 1] || 1 < Abs[l[[If[i == n, 0, i] + 1]] - l[[i]] + 1], 0, b[ReplacePart[l, i -> l[[i]] - 1]]], {i, n}]]]; %t A318191 A[n_, k_] := If[k < 2 || n == 0, 1, b[Join[{n - 1}, Table[n, {k - 1}]]]]; %t A318191 Table[A[n, d - n], {d, 0, 10}, {n, 0, d}] // Flatten (* _Jean-François Alcover_, May 13 2020, after Maple *) %Y A318191 Columns k=0+1, 2 give: A000012, A011782. %Y A318191 Rows n=0-2 give: A000012, A000142(n-1) for n>0, A322782/n for n>0. %Y A318191 Main diagonal gives A320443. %Y A318191 Cf. A227655. %K A318191 nonn,tabl %O A318191 0,12 %A A318191 _Alois P. Heinz_, Jan 07 2019