8. Make a full permutation of the elements in the set , such that except for the number at the far left, for each number on the right, there is always a number to the left of whose absolute difference with is 1. The number of permutations that satisfy this condition is
Problem 706
Official solution
8. 128 .
Suppose for a certain permutation that satisfies the conditions, the first element on the left is . Then, among the remaining seven numbers, the numbers greater than , , must be arranged in ascending order; and the numbers less than , , must be arranged in descending order (not necessarily adjacent).
In fact, for any number greater than , assume .
If is placed to the left of , then the other number that differs by 1 from must be placed to the left of ; similarly, the other number that differs by 1 from must be placed to the left of ; . Then the second number in the permutation cannot differ by 1 from , which is a contradiction.
Therefore, must be placed to the right of .
Similarly, the numbers less than , , must be arranged in descending order.
Since when the first element on the left is determined, there are still seven positions on the right, and any of these positions can be chosen to fill in the numbers greater than (the remaining positions will fill in the numbers less than ), the number of ways to choose is ; and once the positions are chosen, the method of filling in the numbers is uniquely determined.
Therefore, the total number of permutations is