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.
 A: Since 4, 9 and 25 are relatively prime, the Chinese remainder theorem guarantees that the number of blocks $X$ is unique modulo $4\cdot9\cdot25=900$.
$X\equiv4\bmod9$ and $X\equiv4\bmod25$ imply $X\equiv4\bmod225$ (the product of 9 and 25). Add 225 repeatedly to 4 until arriving at a number that is $2\bmod 4$:
$$4+225+225=454\equiv2\bmod4$$
This is $X\bmod900$; now add 900 repeatedly to 454 until arriving at a number between 8000 and 10000. The possible values for $X$ are thus
$$454+900\cdot9=8554$$
$$454+900\cdot10=9454$$
A: 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$
A: $n \equiv 4 \pmod 9\\n \equiv 4 \pmod {25}$
So
$n \equiv 4 \pmod {225}$
Possible numbers are $8104,
8329,
8554,
8779,
9004,
9229,
9454,
9679,
9904$
Last two digits of above numbers are $04,
29,
54,
79,
04,
29,
54,
79,
04
$
Last two digits added by $2$ of above numbers are $06,31,56,81,06,31,56,81,06$
Only $56$ is divisible by $4$
Corresponding numbers are $8554$ and $9454$
these are the required numbers
