What is the smallest positive integer $n$ for which $n^2$ is divisible by 18 and $n^3$ is divisible by 640?
The smallest integer is 120, since:
120^2 mod 18 = 0, and
120^3 mod 640 = 0.