The question asks:
I could get a lowest of 17 with 28, 32, 45, but the answer is 4.
Other than trying again and again, is there a fast and accurate way to solve this?
The question asks:
I could get a lowest of 17 with 28, 32, 45, but the answer is 4.
Other than trying again and again, is there a fast and accurate way to solve this?
On
Note that $8! = 40320$. Note that if $a < b < c$, then $a,b,c$ must be very close to the cube root of $40320$, which you can easily estimate to be between $30$ and $40$, since $3^3 = 27 < 40 < 4^3 = 64$, so we can predict the first digit easily.
Therefore, the desired numbers have to be somewhere around the $30-40$ mark. Let us write down the factors of $8!$ which do occur in this range : they are $30,32,35,36,40$.
Note that $7$ is a multiple of $8!$, and only one of the above is a multiple of $7$. So that means $35$ is a candidate.
Now, you can easily see from the leftovers: $$ \color{orange}1 \times \color{orange}2 \times \color{orange}3 \times \color{green}{ 4}\times \color{blue}{5}\times \color{orange}6\times \color{blue}{7}\times \color{green}{8} $$
that $32 \times 35 \times 36 = 40320 = 8!$. Hence, the desired difference is $4$. Furthermore, this cannot be improved since $32,35,36$ are consecutive factors of $8!$, hence we cannot find factors that are closer than the following trio.
The prime factorization of $8!$ is $$ 8!=2^7\cdot3^2\cdot5\cdot7. $$ We want the three factors $a,b,c$ to be roughly the same, so both should be approximately $(8!)^{1/3}\approx 34$. This suggests one factor could be $2^5$, another factor could be $5\cdot 7$, and then the remaining factor of $2^2\cdot 9$. This gives $a=32,b=35,c=36$.
It is not possible to get $c-a=3$. Note that $c$ must be greater than $(8!)^{1/3}$, so $c\geq 35$. Note $17$ doesn't divide $8!$, nor does $11$, so the next smallest factor is $32$. This is impossible; hence we need in fact $c\geq 36$, in which case the optimal solution is as guessed above.