Multiple of 17 |
Theorem: If you drop the last digit d of an integer n (n10), subtract 5d from the remaining integer, then the difference is a multiple of 17 if and only if n is a multiple of 17.
For example, 34 is a multiple of 17, because 3-20=-17 is a multiple of 17; 201 is not a multiple of 17, because 20-5=15 is not a multiple of 17.
Given a positive integer n, your task is to determine whether it is a multiple of 17.
34 201 2098765413 1717171717171717171717171717171717171717171717171718 0
1 0 1 0
Problemsetter: Rujia Liu, Special Thanks: Yiming Li