These remainder problems can be solved by multivariate equations.
Let the total number be n, 3 numbers have X heap residue 2, 4 numbers have Y heap residue 3, and 5 numbers have Z heap residue 4 (X, Y and Z are natural numbers).
Then n=3x+2=4y+3=5z+4.
Because 3x+2=4y+3, y = (3x-1)/4 = (3 (x+1)-4)/4. . . . . . . The key step is to digitize the molecule in the Y expression into an integer multiple of 4, so 3(x+ 1) must also be an integer multiple of 4.
Because 3x+2=5z+4, z=(3x-2)5=(3(x+ 1)-5)/5. . . . . . . Similarly, if the numerator in the Z expression is digitized as an integer multiple of 5, then 5(x+ 1) must also be an integer multiple of 5.
Therefore, (x+ 1) can be divisible by 4 and 5 at the same time.
The value of (x+ 1) can be: 20, 40, 60. .....
When x+ 1=20
n=3x+2=3*(20- 1)+2=59
When x+ 1=40
n = 3x+2 = 3 *(4- 1)+2 = 1 19
Actually, there is a simpler way to solve this problem.
Look at the problem carefully, whether it is 3, 4 or 5, the remainder is only smaller than the divisor 1.
Then if you put an extra shell in it, the numbers 3, 4 and 5 are exactly the whole pile.
Obviously, the total number of shells plus 1 is the common multiple of 3, 4 and 5: 60, 120, 180. ......
So the number of shells should be 59 1 19 179. .....