ParityDiscrete Mathematics Level 3
The number 1, 2, 3, ..., n are written in sequence. You're allowed to permute any two numbers. We say that the number k is cool if it is possible to do k permutations and end with the original sequence. How many cool numbers there is between 1 and 1000 including 1 and 1000.