ROSECODE 482
Period of permutation
Let be a permutation of the set where is a positive integer. A permutation can also be viewed as a function . We denote this permutation by the 2-by- array
It maps number 1 to , number 2 to and so on. When this function operates on a permutation of set , that is , a new permutation can be obtained. Here .
For example, when and there is a permutation . We make this permutation operate on a permutation continuously, and it will be
Obviously after 4 operations the result permutation returns to the initial one.
Let be the number of permutations of the set which makes the permutation returns to itself after operations. For instance, , as there are 9 permutations meet the condition: , , , , , , , , . You are also given , , .
Let . Find .
Thanks to baihacker for the idea.
For example, when
Let
Let
Thanks to baihacker for the idea.