Problem: if 5 a + 7 b = m , where a and b are positive integers , what is the largest possible value of m for which exactly one pair of integers ( a , b ) makes the equation true ?
Rationale: 5 * a 1 + 7 * b 1 = m 5 * a 2 + 7 * b 2 = m 5 * ( a 1 - a 2 ) = 7 * ( b 2 - b 1 ) since we are dealing with integers we can assume that a 1 - a 2 = 7 * q and b 2 - b 1 = 5 * q where q is integer , so whenever we get a pair for ( a ; b ) we can find another one by simply adding 7 to a and subtracting 5 from b or vice versa , subtracting 7 from a and adding 5 to b . lets check how it works for our numbers , starting from the largest : e ) 74 = 5 * 12 + 7 * 2 ( a 1 = 12 , b 1 = 2 ) , subtract 7 from a and add 5 to b respectively , so a 2 = 5 and b 2 = 7 , second pair - bad d ) 70 = 5 * 7 + 7 * 5 ( a 1 = 7 , b 1 = 5 ) , if we add 7 toawe will have to subtract 5 from b but b ca n ' t be 0 , so - no pair , if we subtract 7 froma , we ' ll get a = 0 which also is n ' t allowed - no pair , thus this is the only pair for ( a ; b ) that works , good ! , thus d is the answer
annotated_formula: add(multiply(7, add(const_3, const_4)), multiply(5, const_4))