Number of cubes We have $X$ cubes with $8000\le X\le10000$.
We have built columns with $2×2$ bases, leaving 2 cubes. We have also built columns with $3×3$ and $5×5$ bases, leaving 4 cubes in these cases.

How can we calculate the number of cubes?

I have created the equations
$$n\equiv2\bmod4$$
$$n\equiv4\bmod9$$
$$n\equiv4\bmod25$$
but I am not sure how to proceed in calculating the right number. What is the best way to calculate it? Thanks for help.

The Chinese Remainder is used for calculating a number $n$ in this case that when divided by $4$ has remainder $2$, by $9$ remainder $4$ and by $25$ remainder $4$.
Then $lcm(4,9,25) = 900$ and we need $a+b+c \equiv r \pmod{900}$
Let's start calculating $a=2\cdot9\cdot25\cdot t$ where $t_1 \equiv (9\cdot25)^{-1} \pmod 4$. 
Then $t_1 \equiv 225^1 \equiv 1 \pmod 4$ and $a=450$
For $b=4\cdot4\cdot25\cdot t_2$ where $t_2 \equiv (4\cdot25)^{-1} \pmod 9$.
Then $t_2 \equiv 1 \equiv 100^5 \pmod 9$ and $b=400$
For $c=4\cdot4\cdot9\cdot t_3$ where $t_3 \equiv (4\cdot9)^{-1} \pmod 9$
Then $t_3 \equiv 16 \equiv 36^{19} \pmod{25}$ and $c=2304$
Thus $454 \equiv a+b+c \equiv 3154 \pmod{900}$ so $n=454$ but we aren't done yet.
Since you want that $n$ satisfies $8000<n<10000$ then $n=8554$ or $n=9454$
