4. To build a batch of identical houses with a total area of $2500 \mathrm{~m}^{2}$, the cost of a $a \mathrm{~m}^{2}$ house is the sum of material cost $100 p_{1} a^{\frac{3}{2}}$ yuan, construction cost $100 p_{2} a$ yuan, and other various expenses $100 p_{3} a^{\frac{1}{2}}$ yuan, where the numbers $p_{1} 、 p_{2} 、 p_{3}$ are three consecutive terms of a geometric sequence, their sum is 21, and their product is 64. If 63 such houses are built, the material cost will be less than the sum of the construction cost and other various expenses. To minimize the total cost, what is the maximum number of houses that can be built?
4. From the problem, we know that $P_{2}^{2}=p_{1} p_{3}, p_{1}+p_{2}+p_{3}=21, p_{1} p_{2} p_{3}=64$, solving these equations yields $p_{1}=1, p_{2}=4, p_{3}=$ 16 or $p_{1}=16, p_{2}=4, p_{3}=1$. Let the total number of houses built be $n$, then $n a=2500$, the total cost of building $n$ houses is $f(n)=100 n\left(p_{1} \cdot \frac{50^{3}}{n^{\frac{3}{2}}}+p_{2} \cdot \frac{50^{2}}{n}+p_{3} \cdot \frac{50}{\sqrt{n}}\right)$, which is $f(x)=100 \times 50^{2}\left(p_{1} \frac{50}{\sqrt{n}}+p_{2}+\frac{p_{3} \sqrt{n}}{50}\right)$. When $n=63$, $p_{1} \cdot \frac{50}{\sqrt{63}}4+\frac{\sqrt{63}}{50}$. 
Scenario (1) fits the problem, i.e., $f(n)=100 \times 50^{2}\left(\frac{50}{\sqrt{n}}+4+\frac{16 \sqrt{n}}{50}\right)$. The function $g(x)=\frac{50}{\sqrt{x}}+\frac{16 \sqrt{x}}{50}$ is decreasing on the interval $\left(0,156 \frac{1}{4}\right)$ and increasing on $\left(156 \frac{1}{4},+\infty\right)$, thus when $n=156$ or $n=157$, $f(n)$ is minimized. However, $f(156)<f(157)$, so building 156 houses results in the lowest total cost.