next up previous
Next: About this document

Solutions to Golomb's Puzzle Column Number 31:

A Divisibility Problem


Solomon W. Golomb

An integer n is divisible by both a and b iff n is divisible by LCM (a,b). Since LCM(7,17) = 119, we need to find an integer n such that both n and the sum of its digits are multiples of 119. If we write where the digits 119 are repeated one hundred and nineteen times, we have a positive integer N such that both N and , the sum of the digits of N, are divisible by both 7 and 17, but this N, with 357 digits, is certainly not the smallest solution.

The smallest positive integer K such that is (a multiple of) 119 is readily seen to be K=29,999,999,999,999, a 14-digit number; but long division reveals that (mod 119).

Our procedure is to increase K as little as possible to a new integer , where , but such that (mod 119). Specifically, we will increase the leading digit of K by the smallest positive integer r such that we can decrease other digits of K by a total amount r, thus preserving , while obtaining (mod 119). To assist in this task, we calculate (mod 119) for :

If we increase the leading digit of K by 1, we add 45 to its remainder modulo 119, getting a total of (modulo 119). From the Table, we see that there is no digit of K, which, if decreased by 1, will add 59 (or, subtract 60), modulo 119.

Next, we increase the leading digit of K by 2, giving a remainder of (mod 119). We can reduce other digits of K by a total of 2 (keeping ) to add the needed 14 (mod 119) in exactly one way:

Thus, we take

where , and ; and is the smallest positive integer such that both and are multiples of both 7 and 17.





next up previous
Next: About this document



Ramesh Rao
Sun Oct 22 17:02:09 PDT 1995