The principle of inclusion and exclusion: How many permutations of the set $\{1, 2,. . . , 8\}$ do not leave any even number in its place?

Let $A_k$ be the number of permutations that fix the $2k$-th element. By Inclusion-Exclusion, $$|A_1\cup A_2\cup A_3\cup A_4|=\sum_{1\leq w\leq4}|A_w|- \sum_{1\leq w<x\leq4}|A_w\cap A_x| +\sum_{1\leq w<x<y\leq4}|A_w\cap A_x\cap A_y|- \sum_{1\leq w<x<y<z\leq4}|A_w\cap A_x\cap A_y\cap A_z|$$ $$=\binom{4}{1}\cdot 7!-\binom{4}{2}\cdot 6!+\binom{4}{3}\cdot 5!-\binom{4}{4}\cdot4!=16296.$$This counts the number of permutations that fix at least one of the even elements, so our final answer is $8!-16296=24024$.


Let $S_j$ be the set of arrangements with $2j$ left in place. Then $$ N_k=\overbrace{\ \ \ \binom{n}{k}\ \ \ }^{\substack{\text{number of}\\\text{ways to pick}\\\text{the $k$ fixed}\\\text{numbers}}}\overbrace{\vphantom{\binom{n}{k}}(2n-k)!}^{\substack{\text{arrangements}\\\text{of the}\\\text{remaining}\\\text{numbers}}} $$ According to the Generalized Inclusion-Exclusion Principle, the number of arrangements in none of the $S_j$ is $$ \sum_{k=0}^n(-1)^kN_k $$ for $n=4$, this gives $$ \binom{4}{0}8!-\binom{4}{1}7!+\binom{4}{2}6!-\binom{4}{3}5!+\binom{4}{4}4!=24024 $$