- Seven-digit numbers that contain no 5 or 6. We have seven digits available (1, 2, 3, 4, 7, 8, 9) to fill seven slots, so there are 7!=5040
- Seven-digit numbers that contain a 5 or 6 but not both. There are two choices for the required digit, seven positions for the required digit, and seven digits available to fill the remaining six slots, so there are 2×7×7P6=70560
- Seven-digit numbers that contain both 5 and 6, but not adjacent. To count these, we first count the possible ways we can place the 5 and 6. If we place the 5 at either end, we have five positions available for the 6, which gives us 2×5=10 possibilities. If we place the 5 in one of the five medial position, we have four positions available for the 6 so there are 5×4=20 possibilities. For each of these possibilities, we have seven digits available to fill the remaining five slots. So there are a total of (10+20)×7P5=75600
These cases cover the ways of meeting the criteria. Adding the counts together, we get:
5040+70560+75600=151200
Comments