OFFSET
0,3
COMMENTS
Also the number of (n^2-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that the absolute difference of the dimension indices used in consecutive steps is <= 1.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..40
FORMULA
a(n) = A208673(n,n).
EXAMPLE
a(2) = 3:
+----+ +----+ +----+
|aabb| |abab| |abba|
+----+ +----+ +----+
|1222| |1122| |1112|
|0012| |0112| |0122|
+----+ +----+ +----+
|xx | |x x | |x x|
| xx| | x x| | xx |
+----+ +----+ +----+
a(3) = 37: aaabbbccc, aaabbcbcc, aaabbccbc, aaabbcccb, aaabcbbcc, aaabcbcbc, aaabcbccb, aaabccbbc, aaabccbcb, aaabcccbb, aababbccc, aababcbcc, aababccbc, aababcccb, aabbabccc, aabbcccba, aabcbabcc, aabcbccba, aabccbabc, aabccbcba, aabcccbab, aabcccbba, abaabbccc, abaabcbcc, abaabccbc, abaabcccb, abababccc, ababcccba, abbaabccc, abbcccbaa, abcbaabcc, abcbccbaa, abccbaabc, abccbcbaa, abcccbaab, abcccbaba, abcccbbaa.
MAPLE
b:= proc(l, t) option remember; (n-> `if`(l=[0$n], 1,
add(`if`(l[i]=0, 0, b(subsop(i=l[i]-1, l), i)),
i=max(1, t-1)..min(n, t+1))))(nops(l))
end:
a:= n-> b([n$n], 0):
seq(a(n), n=0..6);
MATHEMATICA
b[l_, t_] := b[l, t] = Function [n, If[l == Array[0&, n], 1,
Sum[If[l[[i]] == 0, 0, b[ReplacePart[l, i -> l[[i]] - 1], i]],
{i, Max[1, t - 1], Min[n, t + 1]}]]][Length[l]];
a[n_] := b[Array[n&, n], 0];
Table[Print[n, " ", a[n]]; a[n], {n, 0, 7}] (* Jean-François Alcover, May 16 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 18 2022
STATUS
approved