login
A392274
Number of length n words over the alphabet [5] such that any prefix satisfies c(1) >= c(2), c(1) >= c(3), c(2) >= c(4), c(3) >= c(5), and c(4) >= c(5), where c(i) is the number of occurrences of the letter i.
2
1, 1, 3, 8, 23, 73, 246, 867, 3166, 11839, 45785, 179579, 717113, 2908753, 11954189, 49750400, 208980669, 885742796, 3787356399, 16314829868, 70763117954, 308802296807, 1355046242737, 5978469864061, 26504591207399, 118019589079173, 527734730588274, 2368700497250917
OFFSET
0,3
LINKS
John Tyler Rascoe, Python code.
EXAMPLE
All prefixes of the word [1, 3, 2, 4, 1, 5, 3] satisfy the required conditions so this word is counted under a(7) = 867.
a(3) = 8: [1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 1], [1, 2, 3], [1, 2, 4], [1, 3, 1], [1, 3, 2].
MAPLE
b:= proc(n, l) option remember; `if`(n=0, 1, `if`(min(l[1], l[3])>0,
b(n-1, map(x-> x-1, l)), 0)+add((h-> `if`(h[1]>h[2] or h[2]>h[4]
or h[3]>h[4], 0, b(n-1, h)))(subsop(j=l[j]+1, l)), j=1..4))
end:
a:= n-> b(n, [0$4]):
seq(a(n), n=0..27); # Alois P. Heinz, Jan 10 2026
MATHEMATICA
b[n_, l_] := b[n, l] = If[n == 0, 1, If[Min[l[[1]], l[[3]]] > 0, b[n-1, l-1], 0] + Sum[Function[h, If[h[[1]] > h[[2]] || h[[2]] > h[[4]] || h[[3]] > h[[4]], 0, b[n-1, h]]][ReplacePart[l, j -> l[[j]]+1]], {j, 1, 4}]];
a[n_] := b[n, {0, 0, 0, 0}];
Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Apr 09 2026, after Alois P. Heinz *)
PROG
(Python) # see links
CROSSREFS
KEYWORD
nonn
AUTHOR
John Tyler Rascoe, Jan 05 2026
EXTENSIONS
a(15)-a(27) from Alois P. Heinz, Jan 10 2026
STATUS
approved