Problem: which is the least number that must be subtracted from 1856 so that the remainder when divided by 7 , 12 , 10 is 4 ?
Rationale: first we need to figure out what numbers are exactly divisible by 7 , 12,10 . this will be the set { lcm , lcmx 2 , lcmx 3 , . . . } lcm ( 7 , 12,10 ) = 42 * 10 = 420 the numbers which will leave remainder 4 will be { 420 + 4 , 420 x 2 + 4 , , . . . } the largest such number less than or equal to 1856 is 420 * 4 + 4 or 1684 to obtain this you need to subtract 172 . b
annotated_formula: subtract(1856, add(4, multiply(gcd(1856, lcm(lcm(7, 12), 10)), lcm(lcm(7, 12), 10))))