18. There are several students, forming a rectangular array that is exactly eight columns wide. If 120 more students are added to or 120 students are removed from the array, a square array can be formed. How many students are there in the original rectangular array?
【Analysis】Let the original rectangular formation have $x$ students,
and let $\left\{\begin{array}{l}x+120=a^{2} \\ x-120=b^{2}\end{array}\right.$
Then $a^{2}-b^{2}=240$
$$
(a+b)(a-b)=240
$$

And
$$
\begin{array}{l}
240=1 \times 240=2 \times 120=3 \times 80=4 \times 60=5 \times 48 \\
=6 \times 40=8 \times 30=10 \times 24=12 \times 20=15 \times 16
\end{array}
$$

Since the students can form a rectangular formation with eight columns,
$$
\therefore 8|x \Rightarrow 8| x+120 \Rightarrow 8\left|a^{2} \Rightarrow 4\right| a
$$

Similarly, $4 \mid b$
$$
\begin{array}{l}
\therefore 4|a+b, 4| a-b \\
\therefore\left\{\begin{array} { l } 
{ a + b = 6 0 } \\
{ a - b = 4 }
\end{array} \text { or } \left\{\begin{array}{l}
a+b=20 \\
a-b=12
\end{array}\right.\right. \\
\Rightarrow\left\{\begin{array} { l } 
{ a = 3 2 } \\
{ b = 2 8 } \\
{ x = 9 0 4 }
\end{array} \text { or } \left\{\begin{array}{l}
a=16 \\
b=4 \\
x=136
\end{array}\right.\right.
\end{array}
$$

Therefore, the original rectangular formation has 904 students or 136 students.