login
A209349
Number A(n,k) of initially rising meander words, where each letter of the cyclic k-ary alphabet occurs n times; square array A(n,k), n>=0, k>=0, read by antidiagonals.
6
1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 5, 1, 0, 1, 1, 1, 9, 29, 1, 0, 1, 1, 1, 11, 100, 182, 1, 0, 1, 1, 1, 16, 182, 1225, 1198, 1, 0, 1, 1, 1, 19, 484, 3542, 15876, 8142, 1, 0, 1, 1, 1, 25, 902, 17956, 76258, 213444, 56620, 1, 0, 1
OFFSET
0,18
COMMENTS
In a meander word letters of neighboring positions have to be neighbors in the alphabet, where in a cyclic alphabet the first and the last letters are considered neighbors too. The words are not considered cyclic here.
A word is initially rising if it is empty or if it begins with the first letter of the alphabet that can only be followed by the second letter in this word position.
A(n,k) is also the number of (n*k-1)-step walks on k-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that the indices of dimensions used in consecutive steps differ by 1 or are in the set {1,k}.
LINKS
EXAMPLE
A(0,0) = A(0,k) = A(n,0) = 1: the empty word.
A(1,1) = 1 = |{a}|.
A(2,1) = 0 = |{ }|.
A(2,2) = 1 = |{abab}|.
A(2,3) = 5 = |{abacbc, abcabc, abcacb, abcbac, abcbca}|.
A(1,4) = 1 = |{abcd}|.
A(2,4) = 9 = |{ababcdcd, abadcbcd, abadcdcb, abcbadcd, abcbcdad, abcdabcd, abcdadcb, abcdcbad, abcdcdab}|.
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, ...
1, 0, 1, 5, 9, 11, 16, ...
1, 0, 1, 29, 100, 182, 484, ...
1, 0, 1, 182, 1225, 3542, 17956, ...
1, 0, 1, 1198, 15876, 76258, 749956, ...
1, 0, 1, 8142, 213444, 1753522, 33779344, ...
MAPLE
b:= proc() option remember; local n; n:= nargs;
`if`({args}={0}, 1,
`if`(args[2]>0, b(args[2]-1, args[i]$i=3..n, args[1]), 0)+
`if`(n>2 and args[n]>0, b(args[n]-1, args[i]$i=1..n-1), 0))
end:
A:= (n, k)-> `if`(n<2, 1, `if`(k<2, 1-k, b((n-1)$2, n$(k-2)))):
seq(seq(A(n, d-n), n=0..d), d=0..10);
MATHEMATICA
b[args_List] := b[args] = Module[{n = Length[args]}, If[Union[args] == {0}, 1, If[args[[2]] > 0, b[Join[{args[[2]] - 1}, args[[3 ;; n]], { args[[1]]}]], 0] + If[n > 2 && args[[n]] > 0, b[Join[{args[[n]] - 1}, args[[1 ;; n - 1]]]], 0]]]; A[n_, k_] := If[n < 2, 1, If[k < 2, 1 - k, b[Join[{n - 1, n - 1}, Array[n&, k - 2]]]]]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Jan 21 2015, after Alois P. Heinz *)
CROSSREFS
Rows n=0+1, 2-3 give: A000012, A209350, A240954.
Columns k=0+2, 3-7 give: A000012, A190917 = A110706/6, A060150 = A088218^2, A209351, A209352, A209353.
Sequence in context: A361353 A281563 A293087 * A242095 A336169 A007912
KEYWORD
nonn,tabl,walk
AUTHOR
Alois P. Heinz, Mar 06 2012
STATUS
approved