A292720
Number of multisets of nonempty words with a total of n letters over 5-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
Original entry on oeis.org
1, 1, 4, 14, 67, 343, 1431, 6620, 31539, 151680, 769374, 3586756, 17500630, 85727012, 420986605, 2116435479, 10254063794, 50697425138, 251055167912, 1244053731675, 6246442090103, 30737278735067, 152890117563022, 761050222982081, 3790169351183134
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
add(b(n-j, j, t-1)/j!, j=i..n/t))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
b(d, 0, 5), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
end:
seq(a(n), n=0..35);
A292721
Number of multisets of nonempty words with a total of n letters over 6-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
Original entry on oeis.org
1, 1, 4, 14, 67, 343, 2151, 9860, 53739, 279360, 1595454, 8733436, 53035750, 280946972, 1626421033, 9103196607, 53266673126, 300953629850, 1817236258604, 10114067087883, 59666856128423, 342703064143223, 2024687556279346, 11644875879288821, 70172335165701018
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
add(b(n-j, j, t-1)/j!, j=i..n/t))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
b(d, 0, 6), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
end:
seq(a(n), n=0..35);
A292722
Number of multisets of nonempty words with a total of n letters over 7-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
Original entry on oeis.org
1, 1, 4, 14, 67, 343, 2151, 14900, 78939, 470880, 2805054, 17296396, 110869750, 716116412, 4868928433, 30169477167, 196213489166, 1272224938490, 8371053970724, 55530391931787, 369148740629927, 2514270810574079, 16452249276575722, 109991261928916853
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
add(b(n-j, j, t-1)/j!, j=i..n/t))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
b(d, 0, 7), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
end:
seq(a(n), n=0..35);
A292723
Number of multisets of nonempty words with a total of n letters over 8-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
Original entry on oeis.org
1, 1, 4, 14, 67, 343, 2151, 14900, 119259, 692640, 4659774, 30077836, 209311030, 1433872892, 10689029713, 76772260527, 600293120366, 4142024767610, 30775147154084, 221566161988587, 1663421685691847, 12221938274124959, 93706886872251562, 696726353909296853
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
add(b(n-j, j, t-1)/j!, j=i..n/t))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
b(d, 0, 8), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
end:
seq(a(n), n=0..35);
A292724
Number of multisets of nonempty words with a total of n letters over 9-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
Original entry on oeis.org
1, 1, 4, 14, 67, 343, 2151, 14900, 119259, 1055520, 6837054, 49975756, 358031350, 2673108092, 20399335633, 161247005007, 1321885836686, 10814140769210, 93349395210404, 726371063425227, 5939975798740967, 48195816632614079, 396235068140514442
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
add(b(n-j, j, t-1)/j!, j=i..n/t))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
b(d, 0, 9), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
end:
seq(a(n), n=0..35);
A292725
Number of multisets of nonempty words with a total of n letters over 10-ary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
Original entry on oeis.org
1, 1, 4, 14, 67, 343, 2151, 14900, 119259, 1055520, 10465854, 73562956, 592088950, 4560084092, 37322365393, 303133205967, 2640424710926, 22786686453050, 210764523790244, 1891228958070987, 18197644702881767, 155143878113188799, 1411297482751989322
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
add(b(n-j, j, t-1)/j!, j=i..n/t))
end:
a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
b(d, 0, 10), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
end:
seq(a(n), n=0..35);
A381349
Triangle read by rows: T(n,k) is the number of distinct tuples E each corresponding to some k-ary word W = (w_1, ..., w_n), where E is a tuple (e_1, ..., e_{n-1}) with e_i being the number of pairs of equal letters (w_j,w_k) in W such that j + i = k.
Original entry on oeis.org
1, 1, 2, 1, 3, 4, 1, 6, 9, 10, 1, 10, 22, 26, 27, 1, 20, 54, 73, 78, 79, 1, 36, 163, 249, 269, 275, 276, 1, 72, 447, 791, 915, 942, 949, 950, 1, 135, 1350, 3136, 3776, 3899, 3934, 3942, 3943, 1, 272, 4088, 11315, 14849, 15650, 15811, 15855, 15864, 15865
Offset: 1
Triangle begins:
k=1 2 3 4 5 6 7
n=1 1;
n=2 1, 2;
n=3 1, 3, 4;
n=4 1, 6, 9, 10;
n=5 1, 10, 22, 26, 27;
n=6 1, 20, 54, 73, 78, 79;
n=7 1, 36, 163, 249, 269, 275, 276;
...
Considering the pairs of equal letters in W = (1,3,3,1) there is 1 pair with no letters between them, 0 pairs with a single letter between them, and 1 pair seperated by two letters, giving E = (1,0,1).
T(4,2) = 6 counts the following values of E each listed with a corresponding word:
E W
(3,2,1) (1,1,1,1)
(2,1,0) (1,1,1,2)
(2,0,0) (1,1,2,2)
(1,0,1) (1,2,2,1)
(1,1,1) (2,1,2,2)
(0,2,0) (2,1,2,1)
-
from itertools import combinations_with_replacement, permutations
def pairs(m): return tuple([sum(1 for j in range(len(m)-i) if m[j] == m[j+i]) for i in range(1,len(m))])
def A381349(n,k):
S = set()
for y in combinations_with_replacement(range(1,k+1),n-1):
S.update(z for z in permutations((1,)+y))
return len({pairs(i) for i in S})
-
# see links for a different algorithm
from sympy.utilities.iterables import multiset_permutations
from itertools import combinations, combinations_with_replacement
def E(w):
return tuple(sum(1 for j, k in combinations(range(len(w)), 2) if w[j] == w[k] and j+i == k) for i in range(len(w)))
def row(n): # generator of row n
v, S = 0, set()
for k in range(1, n+1):
for c in combinations_with_replacement(range(1, k+1), n-k):
if len(c) > 0 and c[0] == 2: break
S.update(E(e) for e in multiset_permutations(tuple(range(1, k+1))+c))
yield len(S)
print([e for n in range(1, 9) for e in row(n)]) # Michael S. Branicky, Feb 26 2025
Comments