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).

903. 全部置换的幂

我们可以用 一行表示法 π(1),⋯,π(n) 表示 {1,2,⋯,n} 的一个排列 π。我们将 {1,2,⋯,n} 的所有 n! 个排列按字典序升序排序,放入下标从 1 开始的列表内,记 rank(π) 为 π 在这个列表中的位置。

例如,rank(2,1,3)=3。因为 {1,2,3} 的所有 6 个排列按字典序升序排序后的结果是:

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)=5、Q(3)=88、Q(6)=133103808、Q(10)≡468421536(mod109+7)。

求 Q(106) 模 (109+7) 的值。


点 这个链接 回到源站。

点 这个链接 回到详细版题目目录。