x:24=c1 rest 7
x=M₂₄ +7
x:30=c2 rest 7
x=M₃₀ +7
x:18=c3 rest 7
x=M₁₈ +7
x<2000
x=[M₂₄;M₃₀;M₁₈]+7
24=2³ *3
30=2*3 *5
18=2* 3²
x=2³ *3²*5 +7
x=8*9*5+7
x=360+7
x=367
x=360*2+7
x=720+7
x=727
x=360*3+7
x=1080+7
x=1087
x=360*4+7
x=1440+7
x=1447
x=360*5+7
x=1800+7
x=1807
x=360*6+7
x=2160+7
x=2167 care nu poate fi solutie deoarece nu respecta cerinta x<2000
S={367;727;1087;1447;1807}