OFFSET
1,2
COMMENTS
k 1 2 3 4 5 6 7 8 9 10 11 12
---------------------------------------------------------------------------------
n 1| 1 2 6 24 120 720 5040 40320 362880 3628800 39916800 479001600
2| 3 10 54 402 3810 43776
3| 6 28 214 2348 32808
4| 10 60 594 8556
5| 15 110 1334
6| 21 182 2614
7| 28 280
8| 36 408
9| 45 570
10| 55 770
LINKS
Chai Wah Wu, On rearrangement inequalities for multiple sequences, arXiv:2002.10514 [math.CO], 2020-2022.
FORMULA
PROG
(Python)
from itertools import combinations, permutations
from sympy import factorial
def T(n, k): # T(n, k) for A331889
if k == 1:
return n*(n+1)//2
if n == 1:
return int(factorial(k))
if k == 2:
return n*(n+1)*(2*n+1)//3
nk = n*k
nktuple = tuple(range(1, nk+1))
nkset = set(nktuple)
count = int(factorial(nk))
for firsttuple in combinations(nktuple, n):
nexttupleset = nkset-set(firsttuple)
for s in permutations(sorted(nexttupleset), nk-2*n):
llist = sorted(nexttupleset-set(s), reverse=True)
t = list(firsttuple)
for i in range(0, k-2):
itn = i*n
for j in range(n):
t[j] *= s[itn+j]
t.sort()
v = 0
for i in range(n):
v += llist[i]*t[i]
if v < count:
count = v
return count
CROSSREFS
KEYWORD
AUTHOR
Chai Wah Wu, Mar 20 2020
STATUS
approved