Problem 2992 · Medium

Number of Self-Divisible Permutations

Count the orderings of 1 to n where every position shares no common factor above 1 with the value placed there.

Open the interactive visualisation