3
$\begingroup$

You are given the digits from $1$ to $9$. You can form two numbers by concatenating them, for example, $975123$ and $864$, and then take the product of the two resulting numbers. Find how to maximize the product.

To give you a hint, the answer is $87531\cdot9642$.

1 Answers 1

2

You could simply try them all. Since the digits should be listed in decreasing order from left to right, there are only 512 possibilities to check. In Mathematica,

possibilities = Map[FromDigits[Reverse[#]] &,   {#, Complement[Range[9], #]} & /@ Subsets[Range[9]], {2}]; First[Reverse[SortBy[{#, Times @@ #} & /@ possibilities, Last]]] 

{{87531, 9642}, 843973902}

  • 0
    I agree. But the result looks very informative in the sense that there is some rule here. But I am not sure how to formulate.2012-01-12