How would you go about solving these math problems?

These are four very different sorts of problems (as other people have mentioned). Problem 1 is a typical math-contest problem (this is a variant of an International Math Olympiad problem, though I don’t know if it originated there); these are typically designed to have a short, clever solution not requiring too much higher math. (The IMO is a high-school competition.) There are books that teach “problem-solving skills” (like Pólya’s How to Solve It), but solving these problems is largely a matter of practice and inspiration. Problem 2 is a straightforward problem in probability, and problem 4, though incompletely specified, is a straightforward problem in geometry (well, the formulas for area and volume of a torus are not all that common, and their easiest derivations would use calculus). Problem 3 is an instance of a hard research problem; optimal finite packings are not generally known. (Unsolved Problems in Geometry (Croft, Falconer, and Guy) has some discussion of known optima and bounds, and is generally fun to look through.)

A solution is spoilered below. As a hint (this is how I solved it), try filling the boxes starting from 1, and see if you can find any patterns to which arrangements work and which don’t. For example, put card 1 in the red box, 2 in the blue box, and 3 in the white box. Where can card 4 go? Then how about 5? (For an answer, see Lemma 2.) Now put 1 in the red box, and 2 and 3 in the blue box. Where can 4 and 5 go now? (See Lemma 1.)

Apart from the arrangements with at least one empty box, there is only one arrangement (up to permuting the boxes) besides the one MaxTheVool found.

As jawdirk has said, the case in which at least one box is empty trivially satisfies the conditions, so we don’t need to worry about these cases any more. Let’s think about the remaining cases, in which each box contains at least one card. The two examples mentioned above lead to two lemmas that help us. (These lemmas deal with arrangements of sets of 3 or more cards in arithmetic sequences; for example, with the first k cards, or with cards 2, 4, 6, 8, … . They are stated somewhat generally; when reading through them, think of the case a=1, n=1.)

Notation: Label the three boxes X, Y, Z. Write X+Y = {x+y: x in X, y in Y} for the set of all sums of pairs of elements from X*Y.

Lemma 1:Suppose that the k>2 values a, a+n, a+2n, …, a+(k-1)n are all in either X or Y, with at least one such value in each; without loss of generality say that a is in X. If a+nk is in Z, then the X+Z and Y+Z sums contain all of the values 2a+kn, 2a+(k+1)n, …, 2a+(2k-1)n; so these values are not allowed in the X+Y sum. Now Y, by assumption, contains at least one of the values a+n, …, a+(k-1)n; say a+yn is in Y, with 0<y<k. If X also contains one of these values, a+xn with 0<x<k, then since a+(k-1)n is in either X or Y, either (a+(k-1)n)+(a+xn)=2a+(k+x-1)n or (a+(k-1)n)+(a+yn)=2a+(k+y-1)n is in X+Y. But k-1<k+x-1<2k-1 (and similarly k-1<k+y-1<2k-1), so this is equal to an element of either X+Z or Y+Z, violating the requirement. So if a+kn is in Z, then X must contain none of a+n, …, a+(k-1)n, and we must have X={a}, Y={a+n, …, a+(k-1)n}.Lemma 2:Suppose that a is in X, a+n in Y, and a+2n in Z. If a+3n were in Y, we would have a+(a+3n) = 2a+3n = (a+n)+(a+2n) in both X+Y and Y+Z; similarly if a+3n were in Z, the sum 2a+3n would be in both X+Z and Y+Z. So we must have a+3n in X. Similarly a+4n must be in Y, etc. By induction, then, the values a+3kn (for all k) must be in X, a+(3k+1)n in Y, and a+(3k+2)n in Z. (This is MaxTheVool’s example.) Note that the induction works symmetrically in both directions: n may be positive or negative.Putting it all together:[spoiler]Now if 1 and 2 are in the same box (call it X), then we can see by the above that at least one box must be empty. (For suppose 1, …, k are in boxes X and Y only; Lemma 1 (with a=1, n=1) shows that k+1 cannot be in Z, since both 1 and 2 are in X.) So suppose 1 and 2 are in different boxes (1 in X, 2 in Y). Now 3 can be in Z, in which case by Lemma 2 we must have X={1,4,7,…}, Y={2,5,8,…}, Z={3,6,9,…}; or in X, in which case Z must by Lemma 1 remain empty; or in Y. Now further consider this last case: Suppose that 1 is in X, and 2 and 3 in Y. As before, if 4 is in X then (by Lemma 1) Z must be empty; 4 may also be in Y. But if 4 is in Z, then where can 5 go? 5 cannot go in X (by Lemma 2), nor in Y nor Z (in each case, violating the form of Lemma 1 with a=5, n=-1). So this case does not work if we need to add another card to the boxes.

Then by inductively adding cards, we get one more possible arrangement of cards, using the final case considered above: X={1}, Y={2,3,4,…,998}, Z={999}.

So, now let’s count all the arrangements: The mod-3 filling is unique up to permutations of boxes, so it gives 3!=6 possible arrangements. The arrangement above is also unique up to permutation, so this gives us 6 more. All that is left is counting the cases with at least one box empty. There are 3 cases with all the cards in one box. With two boxes nonempty, there are 6 ways of choosing the two boxes, and 2[sup]998[/sup]-1 ways of partitioning 999 cards into two nonempty subsets, giving 6(2[sup]998[/sup]-1) more ways. Collecting these all together gives us

6(2[sup]998[/sup]-1)+6+6+3 = 3*2[sup]999[/sup]+9.[/spoiler]