# Putting apples, pears and oranges into a box (combinatorics?)

There are 674 apples, 674 oranges and 674 pears to be packed into 2 boxes such that both boxes contain 3 types of fruits and the products of the number of apples, oranges and pears in both boxes are the same. Determine the number of ways that this can be done.

So i just wrote abc=(674-a)(674-b)(674-c) and i tried to expand it out and got abc=337(ab + bc + ac), or something like that. Not really seeing how this is going. Can someone give me a hint on how to start this question at least? Thank you.

• Your equation seems to be assuming that $a+b+c=674$, am I right? Note that there is no reason for this to hold. – Arnaud Mortier May 15 '18 at 10:46
• There is an obvious solution $a=b=c=337$. – Arnaud Mortier May 15 '18 at 10:53
• Yes i kind of corrected it afterwards but yup i just expanded it out and got 337 but didn't know how to continue – A. Lim May 15 '18 at 10:57

By expanding the given equation you get $$2abc-674(ab+bc+ac)+674^2(a+b+c)-674^3=0$$ Note that there is no reason why $a+b+c$ would equal $674$.

Now after simplifying by $2$ you see that $abc$ is a multiple of $337$, which is a prime number. Therefore at least one of $a$, $b$ and $c$ has to be a multiple of $337$. But it can't be $674$ (or more), since there has to be at least one of each fruit in each box.

Therefore one of the numbers is $337$. Can you take it from here?

• Ok thank you, i think ive solved it – A. Lim May 15 '18 at 12:57
• @A.Lim You're welcome! – Arnaud Mortier May 15 '18 at 13:49

Suppose $a,b,c$ are integers with $0 < a,b,c < 674$.

From the equation $$abc=(674-a)(674-b)(674-c)$$ we get the congruence $$abc \equiv -abc\;(\text{mod}\;674)$$ or equivalently, $$abc \equiv 0\;(\text{mod}\;337)$$ hence, since $337$ is prime, at least one of $a,b,c$ must be divisible by $337$.

Suppose $337{\,\mid\,}c$.

Since $0 < c < 674$, it follows that $c=337$.

Replacing $c$ by $337$, the initial equation reduces to $$ab=(674-a)(674-b)$$ which simplifies to $$a+b=674$$ If $a < b$, we get $336$ pairs $(a,b)$, and $336$ triples $(a,b,337)$.

Noting that for these triples, all $6$ permutations are distinct, we need to multiply the count by $6$, so we get $(6)(336)=2016$ qualifying triples.

Finally, we need to include the triple $(337,337,337)$, so the final count is $2016+1 = 2017$.

• Ok i see thank you – A. Lim May 15 '18 at 12:58