3

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$.

joriki
  • 238,052
Qiang Li
  • 4,097

1 Answers1

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}

Mark McClure
  • 30,510