how many 3 - digit integers between 311 and 401 , exclusive , are divisible by 3 when the tens digit and the hundered digit are switched ?
answer is 30 no of digits between 311 and 401 ( exclusive ) = 401 - 311 - 1 = 89 no intergers divisble by 3 = ~ 89 / 3 ~ 30 divsiblivity rule for 3 is sum of all digits must be divisble by 3 . it does n ' t matter if hundred digit and tens digits are switched . e . g 372 is divisble by 3 ( becae 3 + 7 + 2 = 12 ( divisble by 3 ) ) switch digits 732 also divisble by 3 ( becae 7 + 3 + 2 = 12 ( divisble by 3 ) ) divsiblivity rule for 3 is sum of all digits must be divisble by 3 . it does n ' t matter if hundred digit and tens digits are switched . you have right . so it is enough to proceed like usual to find the numbers in a given range that are divisible by 3 . so 399 - 312 / 3 + 1 = 30 . answer : a
divide(subtract(401, 311), const_3)