← RoseCode

ROSECODE 468

Permutation Order II

Philippe_57721 · Programming ·

See Problem 467 - Permutation Order I for definitions.

Let A(n,p) be the number of permutations of [1..n] with order p

We have:
A(7,1)=1
A(7,2)=231
A(7,3)=350
A(7,4)=840
A(7,5)=504
A(7,6)=1470
A(7,7)=720
A(7,10)=504
A(7,12)=420

Find the last 10 significant (before trailing 0s) digits of A(1000,641)

[My timing: < 100 ms]