n : 20 = x rest 17 => n = 20x+17 |+3
n : 30 = y rest 27 => n = 30y + 27 |+3
n : 45 = z rest 42 => n = 45z + 42 |+3
=> n + 3 = 20(x + 1)
=> n + 3 = 30(y + 1)
=> n + 3 = 45(z + 1)
20 = 2^2 × 5
30 = 2 × 5 × 3
45 = 3^2 × 5
____________
cmmmc = 2^2 × 3^2 × 5 = 4 × 9 × 5 = 180
n + 3 = 180
n = 180 - 3
n = 177 (numarul cautat )
____________________
177 : 20 = 8 rest 17
177 : 30 = 5 rest 27
177 : 45 = 3 rest 42