which is the least number that must be subtracted from 1256 so that the remainder when divided by 7 , 12 , 16 is 4 ?
"first we need to figure out what numbers are exactly divisible by 7 , 12,16 . this will be the set { lcm , lcmx 2 , lcmx 3 , . . . } lcm ( 7 , 12,16 ) = 48 * 7 = 336 the numbers which will leave remainder 4 will be { 336 + 4 , 336 x 2 + 4 , 336 x 3 + 4 , . . . } the largest such number less than or equal to 1256 is 336 x 3 + 4 or 1012 to obtain this you need to subtract 244 . e"
subtract(1256, add(4, multiply(gcd(1256, lcm(lcm(7, 12), 16)), lcm(lcm(7, 12), 16))))