3

I am helping a kid with the preparation for a mathematical competition. One of the training question is:

Find the smallest positive whole number that is equal to seven times the product of its digits

They do not provide the answer, but using this little python script I found out it is 735:

for i in range(1, 1000):
    digits = [int(x)for x in str(i)]
    prod = 1
    for digit in digits:
        prod = prod * digit
if prod*7 == i:
    print(f"The number is: {i}")
    break

Now I want to find a way that could be resolved just with paper and pencil, as they must do in this mathematical competition.

I tried to write: $$ 100a + 10b + c = 7abc $$

and then I tried many more things, including dividing rule by 7 etc. But I couldn't find a way of solving this if not by brute-force substituting digits for a, b and c and find the values that satisfy the equation.

Thanks!

EDIT

I know it is a 3 digits number, so it must be less than 999, and since 0 is not a digit it must be greater than 111. Since the number is 7 times the product of the digits, I know that $$a*b*c ≤ 999/7$$.

I think rather than 999 we could use 994 which is the greatest nnumber divisible by 7 before 1000.

I tried to do a system of equations but I am missing one more condition to make this work. Maybe it can give you guys some idea.

dd95
  • 229
  • 1
    You can reduce the equation mod 7 to get $2a+3b+c = 7 k$, where $k$ is some integer. Now, since $a$, $b$ and $c$ are bounded above by 9, then $2a+3b+c \leq 54$ so $k$ can be at most $7$. You can quickly see that no solution of $2a + 3b + c = 7$ solves the problem by going through all possibilities, as there are not many of them ($a$ can be at most 3 and neither digit can be 0). There are more possibilities coming from $2a + 3b + c = 14$ to check. Finally, the solution you found is hit for $2 \cdot 7 + 3\cdot 3 + 5 = 28$. However, I consider this as brute force-ish. – Randy Marsh Feb 22 '24 at 11:12
  • 1
    However if the format of the competition is olympiad style with 4 or 5 questions in 2 hours, then the above approach should be ok as it shouldn't take more than 15 minutes to hit 735 and prove there is no smaller solution. – Randy Marsh Feb 22 '24 at 11:19
  • this seems indeed an interesting approach, and definitely would suite a middle school kid. However the mod 7 on 7abc, shouldn't it be 0? If we only perform it on the abc factor then makes sense but its value can't be more than 6 in that case, not 7. Right? – dd95 Feb 22 '24 at 11:25
  • 1
    Yes, 7abc mod 7 is 0. We are taking the mod 7 congruence, so $100a + 10b + c \equiv 7abc \pmod 7$. After reducing the coefficients mod 7 this reduces to $2a + 3b + c \equiv 0 \pmod 7$ which by definition means that $2a+3b+c$ is divisible by 7, that is $2a + 3b + c= 7k$ for some integer $k$. – Randy Marsh Feb 22 '24 at 11:30
  • oh ok, now it makes perfect sense, thanks! – dd95 Feb 22 '24 at 11:31
  • Actually, I am thinking about this again and if a=1, b=1 and c=2, 2a+3b+c=7 2+3+2=7 ... – dd95 Feb 22 '24 at 11:58
  • Yes, $2a+3b+c = 7k$ is only a necessary condition, but not sufficient. Any solution to the original problem must satisfy $2a+3b+c = 7k$ for some $k$, but not every solution to $2a+3b+c = 7k$ for some $k$ is the solution to the original problem. – Randy Marsh Feb 22 '24 at 12:07
  • $100a+10b+c$ is greater than $100a$, but not very far from $100a$ (less than $200a$ in the worst case). So $7abc$ need to be greater than $100a$, but not very far from $100a$. So $bc$ need to be greater than $14$ and no more than $30$ in the worst case. The list of couples $(b,c)$ that match this constraint is small $(3,5)(5,3)(4,4)(2,8)(8,2),(2,9),(9,2),(4,5),(5,4),(3,7),(7,3),(3,8),(8,3),(4,6),(6,4),(5,5),(3,9),(9,3)$ – Lourrran Feb 22 '24 at 13:11
  • where did you get 14 and 30 from? and how do you find the value for a then? – dd95 Feb 22 '24 at 14:12
  • It follows from their observation that $100a < 7abc < 200a$. Divide through with $7a$ to get $14 < bc < 29$. Then $a$ is obtained by substituting $b$ and $c$ into $100a+10b+c=7abc$. Those pairs of $b$ and $c$ for which $a$ will be a whole number will be the solutions. – Randy Marsh Feb 22 '24 at 15:31

2 Answers2

0

One-digit numbers don’t work. Let us try two-digit numbers: $$10a+b=7ab,$$

where $a>0$. We get $b=a(7b-10)$. So $b\le 2$. We check $b=0,1,2$ manually.

Consider three-digit numbers now. Let us write $$10(10a+b)=(7ab-1)c,$$

where $a>0$. Consider three cases.

  • Suppose $c=5$. Then $20a+2b=7ab-1.$ We see that $b$ is an odd digit such that $7b\ge 20$. So we manually check $b=3, 5, 7, 9$.

  • Suppose $c=2$. Then $50a+5b=7ab-1$. Now $7b$ is greater $50$. So $b=8,9$. Check those manually.

  • If $c$ is any other digit then $10\mid 7ab-1$. So $7ab=21,91,161,231,301,371,441, 511$. Or $ab=3, 13, 23, 33, 43, 53, 63, 73$. $13, 23, 33=3\cdot 11, 43, 53, 73$ are impossible. If $ab=3$ then $a=1, b=3$ or vice versa. If $ab=63$ then $a=7,b=9$ or vice versa. We check those four cases manually.

The answer is $735$.

Aig
  • 4,178
  • I am trying to follow your reasoning, but there are a few things I am not sure. To start with, when you say $$b≤2$$ Maybe you meant $$b>2$$?

    Then, how do you know b is odd? and how do you get $$7b≥20$$ ? How about $$a$$? In general I am struggling with understanding your assumptions.

    I have added an edit to my question with sme reasoning I was trying.

    – dd95 Feb 22 '24 at 10:55
  • $b\le 2$ because otherwise $a(7b-10)\ge a\cdot 11$ and can’t be equal to a single digit $b$. If $7b<20$ then $7ab-1<20a-1<20a+2b$. No equality. $b$ is odd because $7ab-1$ is even since it’s equal to $20a+2b$. – Aig Feb 22 '24 at 11:00
0

I would start with a single digit, calculate seven times the sum of the digits, and continue.

Like this you start with $1$, then you get $7$, $49$, $252$, $140$ and you end up with zero.
Then you start with $2$, then you get $14$, $28$, $112$ and you end up with $14$ again.
Then you start with $3$, then you get $21$, leading again to $14$ which generates again the endless loop.

... and like this you continue until you find the solution. (I have no idea, however, if the final solution $735$ is an attractor of this dynamical system)

Dominique
  • 2,130