Coprime Permutations
A permutation of is a rearrangement of these numbers. A coprime permutation is a rearrangement such that all pairs of adjacent numbers are coprime.
Let be the number of coprime permutations of .
For example, as there are two coprime permutations, and . You are also given .
Find and give your answer modulo .
互质重排
的重排是将该集合中的所有数重新排列所得的结果,而互质重排则是相邻两数总是互质的重排。
记为的所有互质重排的数目。
例如,,即存在两种互质重排,分别是和。此外还已知。
求,并对取余作为你的答案。
Gitalking ...