Example 3. Let $S$ be a subset of the set of numbers $\{1,2,3, \cdots, 1989\}$, and the difference between any two numbers in $S$ is not equal to 4 or 7. How many numbers can $S$ contain at most?
Analysis Notice that the sum of 4 and 7 is 11. We first observe the first 11 natural numbers $1,2, \cdots, 11$, and find that $1,4,6,7,9$ satisfy the conditions of the problem. Then we observe the 11 numbers $12,13, \cdots, 22$, and find that $1+11,4+11,6+11,7+11,9+11$ also satisfy the conditions of the problem. And $1,4,6,7,9,12,15,17,18,20$ still satisfy the conditions of the problem. Thus, we have found a periodic number group with a period of 11. This makes the solution approach very clear.

Solution The difference between any two numbers in the array $(1,4,6,7,9)$ is not equal to 4 or 7, and the arrays $(11+1,11+4,11+6,11+7, 11+9), \cdots,(11 k+1,11 k+4,11 k+6,11 k+7,11 k+9), k \in N$, and $11 k+9 \leqslant 1989$, also have this property. On the other hand, the difference between any two numbers in the union of all these arrays is also not equal to 4 or 7. We form the set $S$ by combining all the numbers in these arrays. Noting that $1989=11 \times 180+9$, the number of numbers in $S$ is $5 \times 180+5=905$.

We then prove that $S$ cannot contain more numbers. If not, then among the arrays $(1,2, \cdots, 11),(12,13, \cdots, 22), \cdots,(1970,1971, \cdots, 1980),(1981,1982, \cdots, 1989)$, at least one array can be selected to contain six numbers such that the difference between any two numbers is not 4 or 7. Without loss of generality, consider the array $1,2, \cdots, 11$, and divide them into five groups $(4,7,11),(3,10),(2,6),(5,9),(1,8)$. At least one group must have two numbers selected. Clearly, none of the last four pairs can be selected simultaneously, so only the first group can select 4,7. Thus, in $(3,10)$, only 10 can be selected; in $(2,6)$, only 2 can be selected; in $(5,9)$, only 5 can be selected; and in $(1,8)$, neither number can be selected. In other words, it is impossible to select a sixth number, so $S$ can contain at most 905 numbers.