# Split 1 through 6 into a product of 24 and sum of 12

How many ways are there to split the numbers 1, 2, 3, 4, 5, and 6 into two groups, such that the product of the numbers in one group is 24 and the sum of the numbers in the other group is 12? An answer should enumerate all of the possibilities (if any) and prove that there are no others. (It's possible to figure this out by brute force, since there are only 64 possible partitionings, but there's a more elegant approach that doesn't require this.)

I came up with this puzzle myself.

## 5 Answers

The only possibilities are:

1+5+6=12, 2*3*4=24

Proof:

The product of 24 has no prime factor 5 and exactly one prime factor 3. The number 5 must therefore be used in the sum, as must exactly one of 3 and 6.
If the sum uses 5 and 3, then the only way to get the remaining 4 from 1,2,4,6 is to use the 4, leaving 1,2,6 for the product. This does not work.
So the sum uses 5 and 6, and then must also use the 1 to reach 12. The product is then 2*3*4 which is indeed 24.

Yet another way:

As the sum and product of all six numbers are 21 and 720, we can swap the two groups and ask for sum 9 (21-12) and product 30 (720/24). The 5 must go to the product, the 4 can't, so must go to the sum. This leaves the sum with 5 to go, which can only come from 3 and 2 because 4 and 5 are already assigned. Hence the only possible split is 2,3,4 -- 1,5,6 ; and this is indeed a solution.

• It's one way of doing it... kind of inverting the original problem.... doesn't make much difference on this specific case. – smci Apr 5 at 2:10
• @smci as OP mentions this whole problem isn't much if a challenge in itself. It's kind of an optimization task: find the obvious solution with minimal case work. Arguably, my solution doesn't branch at all, so is optimal in that respect. – loopy walt Apr 5 at 2:26
• Yes, understood, it's a generalization that could solve harder instances of this type with less work. – smci Apr 5 at 4:37

Another way:

The sum of 12 requires at least 3 numbers, since 6+5=11 is too little. So, the product of 24 must consist of at most 3.
Can it be 2 numbers? Yes, 6 * 4. But the remaining numbers do not sum up to 12: 1+2+3+5=11. For the same reason 6 * 4 * 1 would not work. The only remaining way to get 24 is 4 * 3 * 2 (we don't include the 1 since we can have at most 3 numbers), and the other numbers 1, 5 and 6 do indeed sum up to 12.

There is still another way:

The product $$24 = 3 \cdot 2^3$$, so there must be exactly three factors of $$2$$.
Counting factors of $$2$$, $$2$$ has one factor, $$4$$ has two, and $$6$$ has one, so either $$4$$ and $$2$$ are together, or $$4$$ and $$6$$ are. But $$4 \cdot 6 = 24$$ while $$1 + 2 + 3 + 5 \ne 12$$. Thus the only other option is $$4 \cdot 2 \cdot 3 = 24$$ and $$1 + 5 + 6 = 12$$, which works.

• This can be seen as an improvement on trolley813's answer. – Toby Mak Apr 4 at 12:54

Here's how I reasoned through this before posting it. Others' methods turned out to be much simpler, though:

Since 5 isn't a factor of 24, it must be part of the sum group.

The rest of the numbers in the sum group then must add up to 7. Since we don't have a 7, there must be at least two more numbers in it, or in other words, at least three numbers in it total.

The two largest numbers remaining are 4 and 6. If they were the only numbers in the product group, then the sum group would add up to 11 instead of 12. And since those two numbers are the largest, any other set of two or fewer numbers would multiply to less than 24, so there must be at least three numbers in the product group.

Combining the above two sections, there must be exactly three numbers in each group.

If the 2 were in the sum group, then the third number in it would have to be another 5, but we don't have two 5s. Thus, the 2 must be in the product group.

If the 1 were in the product group, then the third number in it would have to be a 12, which we don't have. Thus, the 1 must be in the sum group.

Now that we know the 1 and 5 must be in the sum group, simple subtraction shows the third must be the 6, leaving the 2, 3, and 4 for the product group, which do indeed multiply to 24 as required.

Looking back, I think I know why my solution is longer now: I was originally going to specify that there must be three numbers in each group in the description, but I realized this would make the puzzle too easy. I then grafted steps to derive that fact onto my original solution instead of trying to re-solve it from scratch without needing that intermediate step.

As I think about this some more, here's another way to do it, based on loopy walt's answer and its key insight, but where (IMO) each step has a simpler justification:

We're given that group A has product 24 and group B has sum 12. As the sum and product of all six numbers are 21 and 720, we actually know the sum and product of both groups: group A has sum 9 (21-12) and group B has product 30 (720/24). Since 24 isn't divisible by 5, the 5 must go to group B. Since 30 isn't divisible by 4, the 4 must go to group A. Putting the 6 in group A now would make its sum too high, so it must go to group B. Now the sum of group B is 11 so far, so the only way to make it 12 is to put the 1 in it and the rest of the numbers in group A. This leaves only one candidate: 2, 3, 4 in group A and 1, 5, and 6 in group B. Testing this candidate reveals that it is indeed a solution.