ChallengeMediumCounting: Inclusion–Exclusion & Stars and Bars
Counting: Inclusion–Exclusion & Stars and Bars · Medium problem
How many permutations of have no fixed point in the first three positions; that is, the -th entry differs from for each of (the other positions are unrestricted)?