5. (10 points) 50 balls numbered from 1 to 50 are arranged in a row. Now they are colored according to the following method: (1) color 2 balls; (2) the difference in the numbers of the 2 colored balls is greater than 2. If the two colored balls in one coloring method are different from the two colored balls in another coloring method by at least one number, these two coloring methods are called "different". How many different coloring methods are there?
【Analysis】The first ball is painted, and the other ball is painted from number 4 to number 50, which gives 47 methods; the second ball is painted, and the other ball is painted from number 5 to number 50, which gives 46 methods, ... the 47th ball is painted, and the other ball can only be painted as number 50; according to the principle of addition, the solution can be obtained.

【Solution】Solution: Let the smaller number of the balls to be painted be $K, 1 \leqslant K \leqslant 50-3=47$, then the number of the other ball to be painted could be $K+3, \cdots 50$;

There are a total of $50-(K+2)=48-K$ different ways to paint, $K$ can take values $1,2, \cdots 47$;
Therefore, in total:
$$
\begin{aligned}
& (48-1)+(48-2)+(48-3)+\cdots+(48-47) \\
= & 1+2+\cdots+47 \\
= & (1+47) \div 2 \times 47 \\
= & 24 \times 47 \\
= & 1128
\end{aligned}
$$

Answer: There are 1128 different ways to paint the balls.
The answer is: 1128.