Find the smallest number comprised of only 3’s and 7’s which fits the following conditions:
1) It has at least one 3;
2) It has at least one 7;
3) It is divisible by 3;
4) It is divisible by 7;
5) The sum of its digits is divisible by 3;
6) The sum of its digits is divisible by 7.
(In reply to
Solution (with some trial and error) by Leming)
If you wanted to eliminate some of the trial and error, you could calculate 3*10^n mod 7
3*10^n = {3,2,6,4,5,1,3,2,6,4...}mod 7 (starting with n=0)
The sum of all those is 1 mod 7
Therefore you have to eliminate three of the elements the sum of which must be 1 mod 7.

Posted by Tristan
on 20060409 20:28:21 