0%

Problem 903


Problem 903


Total Permutation Powers

A permutation π of {1,,n} can be represented in one-line notation as π(1),,π(n). If all n! permutations are written in lexicographic order then rank(π) is the position of π in this 1-based list.

For example, rank(2,1,3)=3 because the six permutations of {1,2,3} in lexicographic order are:
1,2,31,3,22,1,32,3,13,1,23,2,1

Let Q(n) be the sum πi=1n!rank(πi), where π ranges over all permutations of {1,,n}, and πi is the permutation arising from applying π i times.

For example, Q(2)=5, Q(3)=88, Q(6)=133103808 and Q(10)468421536(mod109+7).

Find Q(106). Give your answer modulo (109+7).


所有置换的幂

集合{1,,n}的任意置换π可以用一行记法表示为π(1),,π(n)。如果将所有n!个置换按字典序排列,那么rank(π)即是置换π在这个排列中的位置(从1开始计数)。

例如,rank(2,1,3)=3,因为{1,2,3}的六个置换按字典序排列为:
1,2,31,3,22,1,32,3,13,1,23,2,1

Q(n)等于如下求和πi=1n!rank(πi),其中π取遍{1,,n}的所有置换,πi是指将置换π应用i次得到的置换。

已知Q(2)=5Q(3)=88Q(6)=133103808Q(10)468421536(mod109+7)

Q(106),并对(109+7)取余作为你的答案。


0 comments
Anonymous
Markdown is supported

Be the first person to leave a comment!