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.
As stated before, conditions 3 and 5 are equivalent.
Since the sum of digits must be divisible by 3 and 7, there must be a 3n 7's and 7m 3's for some integers n and m > 0.
This means that the minimum number contains 10 digits, 7 of which are 3's and 3 of which are 7's.
Given that if a mod k = r and b mod k = q, (a+b) mod k = (r + q) mod k, we can divide the problems as follows:
3333333333 mod 7 is 1. Now we need to add in 4*10^a, 4*10^b, and 4*10^c, a != b !=c such that (4*10^a + 4*10^b + 4*10^c) mod 7 is 6. We are guaranteed to find such an a, b, and c < 10, since the (4*10^k) mod 7 runs through all values 0 to 6 as k varies from 0 to 6.
Therefore, we want:
a such that (4*10^a) mod 7 is 1
b such that (4*10^b) mod 7 is 2 and
c such that (4*10^c) mod 7 is 3.
Some quick calcuations give that a is 2, b is 4, and c is 3 and the numbers are 400, 40000, and 4000 which add to 44400.
Adding this to 3333333333 gives 3333377733 which satisfies all of the conditions.