$\square\square\times\square =\square\square\square =\square\times\square\square\,\,\,$ fill blanks with distinct numbers from$\{1,2,3,4,5,6,7,8,9\}$

Fill in the blanks of:

$$\square \;\square \times \square = \square \; \square \;\square =\square \times \square \;\square$$

With distinct numbers from the set $\{1,2,3,4,5,6,7,8,9\}$.

I was able to do it by trial-and-error, but I am looking for a more mathematical approach.

-
I don't see how this is linear algebra ... – user67258 Jul 18 '13 at 17:06
Trial-and-error can be a very powerful "mathematical approach"! – Shaun Ault Jul 18 '13 at 17:12
You have 9 numbers: call them $x_{1},x_{2},\dots,x_{9}$. The equations you can set up would be the following: $$(10x_{1}+x_{2})x_{3} =100x_{4}+10x_{5}+x_{6} =x_{7}(10x_{8}+x_{9})$$. The constraints are that $x_{j}\in \{1,2,\dots,9\},$ and $x_{i}\not=x_{j}$ for $i\not=j$. Not sure where to go from here. – Adrian Keister Jul 18 '13 at 17:13
Sometimes, trial-and-error is the only mathematical approach and sometimes the best! – Jeel Shah Jul 18 '13 at 17:13
The only thing slightly more mathematical than "trial and error" here is process of elimination. We know, for example, that $5$ cannot appear in any of the number's $1$'s digit. – Omnomnomnom Jul 18 '13 at 17:13

All right: This is "mathematical". In other words, some reasoning, with a lot of case checking. So, we have that: $$ab\cdot c = de\cdot f = ghi$$

• $b,c,f,e,i$ are not 5. Else requires a zero, or another 5.

• If $ghi$ is odd, then we can see that $b,c,e,f$, and $i$ all have to be odd. This is impossible if none of them are a $5$. Therefore, $ghi$ is even.

• $a$ and $d$ are not a $1$. Else, $g$ would also have be a $1$. We can also see that $c$ and $f$ are not $1$. $b$ and $e$ are not $1$ either. If $b$ was $1$, then $i = c$.

• Thus, either $g$ or $h$ is a $1$.

Now, look at the number $5$. It is either $a,d$, $g$ or $h$.

• First, assume that it is $g$. Then $ghi =51i$. And we can see that this is impossible.

• Next, assume it is $h$. then $ghi = 15i$. $i$ is even. So where is the $9$? $9$ cannot be either $a$ or $d$. So assume it is $b$.

Then we have $a9\cdot c = de\cdot f = 15i$. Since $c$ is odd, $a$ cannot be $2$. If $a =3, c=4$. We have:

$$39\cdot 4 = 156 = 78\cdot 2$$

So if $5= h$, one answer.

Otherwise, $5$ is either $a$ or $d$. Without loss of generality, assume it is $a$, so that $5b\cdot c = de\cdot f = ghi$

Two cases, if $c$ is odd, $50\cdot c = 250$. We know that $g$ or $h$ is $1$. If $h$ is one, $b*c = 60$ something. That is impossible (only $7*9$ = 60 something, and that is odd).

So if $c$ is odd, $g = 1$. $c$ is then obviously $3$.

So we have $5b \cdot 3 = 1hi = de\cdot f$. b cannot be 2. Else, h is 5. If b is 4, we have 54*3 = 162 = ... impossible, as 7, 8, and 9 are left over.

As for $b =6$, we have $56\cdot 3 = 168$. Not possible. 2 instances of 6.

If b is 8. We have $58\cdot 3 = 174 = 29\cdot 6$

Final situation: if c is even.

$5b \cdot c = de \cdot f = ghi$

if $c$ is 2, then $g$ is 1, and $h$ is either 1 or 0. Impossible.

If $c$ is 4 or more, $g$ is not 1, so $h$ is 1.

We have

\begin{align} 5b \cdot c = g1i = de \cdot f \end{align}

If $c$ is 4, $b = 3$. Then $53 \cdot 4 = 212$. Impossible.

If $c$ is 6, $g$ is 3. So b is 2. $52 \cdot 6 = 312$. Impossible.

If $c$ is 8, $g$ is 4. b is 2. $52 \cdot 8=416$. No even numbers left. Therefore, impossible.

Basically, that leaves the two answers.

-
Thanks for editing the answer. – user86828 Jul 18 '13 at 19:16
it would be great if you could finish the edit :) – nbubis Jul 18 '13 at 19:18
Merr, all right. – user86828 Jul 18 '13 at 19:28
@user86828 Great! Thanks! – Mahdi Khosravi Jul 18 '13 at 21:12

A number of observations can be made that narrow down the number of "guesses" that need to be made:

• Neither $x_2$, $x_3$, $x_7$ nor $x_8$ can be a $5$, because this would result in either a $0$ or another $5$ in the evaluation of the product. For the same reason, $x_6$ (the final digit of the product) cannot be $5$.
• Neither $(x_2,x_3)$ nor $(x_7,x_9)$ can be a pair of numbers such that the ones place of their product is one of the multipiers. That is, given a pair of numbers $m$ and $n$, $m\not\equiv mn \pmod{10}$ and $n\not\equiv\pmod{10}$.
• Neither $x_3$ nor $x_7$ can be a $1$, which would result in a $2$ digit product (and a repeat of each digit in the corresponding multiplier).
• You probably want the product to be a multiple of $6.$ It is not guaranteed, but gives more flexibility.
• The only digit pair that multiplies to $1$ is $3\times 7$, so the three-digit number cannot end in $1$. Similarly $3\equiv 7\times 9$ only, $7\equiv 3\times 9$ only, and $9$ is not the product of distinct digits. So the result is even.
-
More than just $x_3$ and $x_7$; a $5$, if it occurs, can only occur in $x_1$, $x_4$, $x_5$, or $x_8$; $5$ in any last digit is forbidden. Similarly, $x_2$ and $x_9$ can't be $1$s, either. Further, we know that $x_6$ must be even - if it were odd then all five of the last digits would be odd, and since there are only four odd numbers to go around (remember, we're not allowed to use $5$ there) then the product must be even. – Steven Stadnicki Jul 18 '13 at 18:30

For general reference, a brute force approach leads to there only being two distinct solutions: $$29 \cdot 6 = 174 = 58 \cdot 3$$ $$39 \cdot 4 = 156 = 78 \cdot 2$$

Edit: If you want to see this for yourself:

import itertools
l = itertools.permutations(range(1,10))
for x in l:
a, b, c = (10*x[0] + x[1]) * x[2], 100*x[3] + 10*x[4]+ x[5], (10*x[6] + x[7])*x[8]
if (a == b and b == c):
print 10*x[0] + x[1], "*", x[2], "=", b, "=", 10*x[6] + x[7], "*", x[8]

-
How do we know that these are the only two? – Ataraxia Jul 18 '13 at 18:32
@ZettaSuro - brute force. – nbubis Jul 18 '13 at 18:33
Of course it can be done by programming , But the question is mathematical approach – Harish Kayarohanam Jul 18 '13 at 18:37
@HarishKayarohanam - I know, but I thought the actual solutions may be useful, both for the OP and also for inspiration as to a "mathematical solution", assuming such a one exists. – nbubis Jul 18 '13 at 18:39
Useful to check. – user86828 Jul 18 '13 at 19:49

Elimination, elimination. $$\overline{x_1x_2} \cdot x_3 = \overline{x_4x_5x_6}= x_7 \cdot \overline{x_8x_9}$$
Let's call : $$\overline{x_1x_2} = a$$ $$\overline{x_4x_5x_6} = b$$ $$\overline{x_8x_9} = c$$ So $$a \cdot x_3 = b = x_7 \cdot c$$

• What we know:
1. $x_3$ or $x_7$ cant't be $1$
2. $a$ or $x_3$ can't be both primes. Also $c$ and $x_7$.
3. $b$ cant't be prime
4. $123\le c\le 776 = 98 *7$
5. Last digit of $a$ or $c$ can't be $1$ because $\color{red}{x_3} \cdot \overline{x_1 1} = \overline{x_4x_5 \color{red}{x_3}}$
6. The last digit of a,b or c can't be $5$

This narows c to 500 numbers. If i have more ideas i will post here.
-