A person wishes to visit 6 cities, each exactly twice, and never visiting the same city twice in a row. In how many ways can this be done?
I tried complement. Define $S(n)$ as the number of permutations wherein exactly $n$ cities are visited twice in a row, then the answer is $S(0)$.
$S(6)$ is simple:
$$S(6) = C_6^6 P_6^6$$
But starting from $S(5)$, things become convoluted because $S(i)$ involves partial $S(i+1)$:
$$ S(5) = C_6^5(\frac{P_7^7} {P_2^2} - C_1^1 P_6^6) $$
$$ S(4) = C_6^4[\frac{P_8^8} {(P_2^2)^2} - C_2^1 (\frac{P_7^7} {P_2^2} - C_1^1 P_6^6) - C_2^2 P_6^6] $$
$$ \vdots $$
You can do this using inclusion–exclusion. There are $2^{k-6}(12-k)!$ arrangements in which $k$ particular cities are visited twice in a row, so there are
$$ 2^{-6}\sum_{k=0}^6(-2)^k\binom6k(12-k)!=2631600 $$
arrangements in which no city is visited twice in a row.