Mathematics (JEE)HardCodeforces Div2 D

How many permutations p of {1, 2, ..., 6} satisfy |p(i) - i| != 1 and p(i) != i for every i from 1 to 6?

  1. A. 29
  2. B. 265
  3. C. 117
  4. D. 455

Correct answer: A. 29

Enumerating the 720 permutations and rejecting any with p(i) = i or |p(i) - i| = 1 for some i leaves 29.

More Permutations, Combinations and Probability questions

Exams that ask this topic