# Find magical solution to magical equation

Solve this magical equation:

$$(M+A+G+I+C) \times (M+A+G+I+C) \times (M+A+G+I+C) = \overline{MAGIC}$$

Each letter represents a separate digit.

$$M=1, A=9, G=6, I=8, C=3$$

Method

The equation simplifies to $$(M+A+G+I+C)^3 = MAGIC$$. The term in brackets is at most $$45$$ and must be at least $$22$$ for the cube to have five digits. It also makes sense to restrict to the case where all the digits are distinct. This happens for the cubes of $$22, 24, 27, 29, 32, 35, 38, 41$$. Among these only the digits in the cube of $$27$$ add up to the number itself ($$27$$)

• For the interested: The answer could also be 26 (26^3 = 17576, 1+7+5+7+6=26) if it weren't for the restriction that each digit be different. – Engineer Toast May 3 '19 at 17:51

(M+A+G+I+C) x (M+A+G+I+C) x (M+A+G+I+C) = MAGIC

Assumptions:
- $$M \ne 0$$ because that would make a 5 digit number starting with $$0$$.
- All the digits of $$MAGIC$$ are unique

Let $$S=M+A+G+I+C$$. The cube of $$S$$ is a 5 digit number. Since $$21 \lt \sqrt{10000} \lt 22$$ and $$46 \lt \sqrt{100000} \lt 47$$, we know that $$22 \le S \le 46$$. But the maximum sum for 5 different digits is $$9+8+7+6+5=35$$. Thus, we can further restrict the range to $$22 \le S \le 35$$.

There are now

12 numbers that we need to check:
$$\begin{array} \\ Number & Cube & Sum & Solution \\ 22 & 10648 & 19 & No \\ 23 & 12167 & 17 & No \\ 24 & 13824 & 18 & No \\ 25 & 15625 & 19 & No \\ 26 & 17576 & 26 & Yes! \\ 27 & 19683 & 27 & Yes! \\ 28 & 21952 & 19 & No \\ 29 & 24389 & 26 & No \\ 30 & 27000 & 9 & No \\ 31 & 29791 & 28 & No \\ 32 & 32768 & 26 & No \\ 33 & 35937 & 27 & No \\ 34 & 39304 & 19 & No \\ 35 & 42875 & 26 & No \\ \end{array}$$

So there are ...

2 solutions! But if you look at the $$S=26, MAGIC=17576$$, we see that $$A=I=7$$ has a repeated digit.

Thus, the only valid solution is:

$$MAGIC=19683$$

The sum is then

$$M+A+G+I+C=1+9+6+8+3=27$$

And the cube is

$$27^3=19683$$