The final round of the South African Mathematics Olympiad will be taking place on Thursday, 28 July 2019. I have been writing about some of the problems from the senior paper from 2018. A list of all of the problems can be found here.

Today we will look at the sixth and final problem from the 2018 South African Mathematics Olympiad:

Let be a positive integer, and let be distinct positive integers with . Construct an table where the entries of the -th row are for . Now follow a procedure where, in each step, two identical entries are removed from the table. This continues until there are no more identical entries in the table.

- Prove that at least three entries remain at the end of the procedure.
- Prove that there are infinitely many possible choices for and such that only three entries remain,

There are some heuristics that are often helpful when solving a problem, such as

**Looking at small cases:**This helps us to understand the problem and how the various pieces in the problem relate to each other. It also helps us to spot patterns that we could try to prove hold in general, or to find ways to build larger solutions from smaller ones.

**Building up larger solutions from smaller ones***(recursion)*Sometimes, such as in this problem, we are asked to find multiple solutions to some problem, and so being able to build larger solutions from smaller ones would be invaluable.

Sometimes we want to count in how many ways certain things can be done. If every solution to a problem can be built from a smaller one, and we know how many solutions there are in the smallest case, this will allow us to establish a recurrence relation.

Trying to build larger solutions from smaller ones also helps to give us more intuition for how the problem works.

**The Extremal Principle:**Often being the largest or smallest item in some set places additional constraints on that item that makes it easier to reason about, or limits how it is able to interact with other items in the set. More examples of using this principle can be found on Brilliant.org.

**Review the solution:**Does the result make sense? Are there other ways to prove the same result? This doesn’t help us that much in solving the current problem, but does give us confidence that our solution is correct, and may help us in solving similar problems in the future.

The first thing that we should notice about this problem is that the order in which we perform the operations is largely irrelevant. A number will remain at the end if and only if it appears an odd number of times in the table. The only thing that the order of deletions can affect is the positions of the numbers at the end, but it can not affect how many of them there are.

In this problem, by far the simplest case is when and . In this case, our table is simply

1 | 2 | 3 |

In this case, exactly three numbers remain. Perhaps if we can find larger examples where exactly three numbers remain, we can try to extract a pattern. It may be the case that the three numbers that remain are precisely the three that are forced to remain in all situations, and so this will give us some insight into how we might go about the proof for the first part of the problem. It will also help us to see how to construct larger examples, which may help us with the second part of the problem.

To build a larger example, we need to duplicate some of the numbers so that they will be crossed out. Since the number can only appear in the first column, and since the must be distinct, we can not create a duplicate of the number , and so the number will always remain.

This is already a valuable piece of insight. We have already identified one of the three numbers that will always remain. Perhaps we can try to generalise what sorts of numbers will always remain. In this case, happens to also be the smallest number in the table, and so this is an example of the extremal principle. The smallest number in the table must appear in the first column, and since the are unique, the smallest number can only appear once. A similar argument shows that the largest number in the table must remain at the end because it can only appear in the third column. We could generalise this argument even further: *any* number which can only appear in one of the three columns must only appear in the table only once.

With this insight stored securely in our arsenal, let us continue trying to build larger examples where only three numbers remain. The next candidate for a number to duplicate is the number $latex2$. This already appears in the second column, and can not appear in the third column, and so let’s make so that it appears in the first column. Now our table looks as follows:

1 | 2 | 3 |

2 | 4 | 6 |

where black cells indicate numbers which have been removed because they are duplicates.

Duplicating the will also get rid of the which we have now created. We could try to remove other numbers, but in each of the other cases, we would remove one number but gain two. Setting gives us

1 | 2 | 3 |

2 | 4 | 6 |

3 | 6 | 9 |

This gives us our second example of a table with exactly three numbers remaining. We note that the fact that there is one number remaining in each column lends support to our earlier idea that a number which can only appear in one of the columns must only appear once in the table. We should try to identify what property of the numbers , and ensure that they only appear in one column. We already know that and remain because they are the smallest and largest numbers, respectively, but what is special about ? We carry on.

If we duplicate the number , we obtain the table

1 | 2 | 3 |

2 | 4 | 6 |

3 | 6 | 9 |

4 | 8 | 12 |

Working with the hypothesis that we only want one number to remain in each column, we should now try to remove the or the . We also know that it is the largest number in the table that will remain in the third column, and since there are already numbers larger than in the table, we should remove the . Placing in the first column thus gives us

1 | 2 | 3 |

2 | 4 | 6 |

3 | 6 | 9 |

4 | 8 | 12 |

9 | 18 | 27 |

The exact same argument now tells us that we should remove the . There are two ways in which this could be accomplished: we could place a in the first column so that appears in the second column, or we could place a in the first column. I will save us from the trial and error that would ensue at this point by pointing out that a placed in the first column could never be removed because then there is already a in all three of the columns. We thus want to place a in the first column. This gives us

1 | 2 | 3 |

2 | 4 | 6 |

3 | 6 | 9 |

4 | 8 | 12 |

9 | 18 | 27 |

12 | 24 | 36 |

A similar argument to before tells us that we should remove the , which can only be done by adding a in the first column.

1 | 2 | 3 |

2 | 4 | 6 |

3 | 6 | 9 |

4 | 8 | 12 |

9 | 18 | 27 |

12 | 24 | 36 |

27 | 54 | 81 |

We could get rid of the , and in one fell swoop by placing a in the first column. We then have to delete either the or the in the second column. Alternatively, we could delete both by placing a in the first column. This turns out to be a better idea, because we then have…

1 | 2 | 3 |

2 | 4 | 6 |

3 | 6 | 9 |

4 | 8 | 12 |

9 | 18 | 27 |

12 | 24 | 36 |

27 | 54 | 81 |

18 | 36 | 54 |

8 | 16 | 24 |

…our third example of a table with only three numbers remaining!

We can’t really claim that this is evidence that there will always be one number remaining in each column, because we explicitly constructed the table with the goal of having one number remain in each column. Thus at best it is evidence that examples of such tables exist, and may help us in constructing larger examples in order to solve the second part of the problem. Let us disabuse ourselves of the notion that we are logical beings, however, and pretend that this table is, *in fact*, representative. What insights could we gain?

We already know that the smallest and largest number will always remain in the table because these can only possibly appear in the first and third column, respectively, so our goal is now to figure out what is special about the numbers that remain in the second column. These numbers were , and . One thing that these have in common is that they are all powers of . It is not, however, the case that powers of can only appear in the second column, because they could also appear in the first column. What, then, is special about the powers of that appear in the second column? Either by being inspired by the fact that when other numbers remained in the table, it had something to do with their size, or through trial and error by looking at what happens when powers of appear in the first column, we come to the realisation that it is the *largest* power of which can only appear in the second column, since if a power of appears in the first column, then a larger one appears in the second column in the same row!

We have thus succeeded in identifying the three numbers that always remain: , the largest power of , and the largest number in the table. In fact, in the cases where exactly three numbers remain, the largest number in the table happens to also be the largest power of in the table, and so an equally valid description of the numbers that always remain would be , the largest power of , and the largest power of .

When we write a solution to the problem, we do not need to include all of the work that we did above. We could simply say that we will prove that , the largest power of , and the largest power of will always remain, and then do so by proving that each of these numbers can only appear in one of the three columns and hence can not be duplicated because to do so would require two of the to be the same. This is how most mathematics is written: we are given the final result without being shown how the author came up with the ideas in the solution. When reading mathematics, it is helpful to try to figure out why certain steps were taken, or what led the author to believe that they may work.

There are of course other ways in which we could come to the realisation that , the largest power of , and the largest power of always remain. In our experimentation, we could have noticed, for example, that whenever we try to get rid of a power of , we just get a larger one in its place. It is thus impossible to eliminate all of the powers of in the table, and so there will always be at least one which remains. We are more likely to notice this, however, if we already have the intuition that powers of are important! When writing the solution, we don’t have to show that it is the largest of power of that always remains. We could make the above argument more formal and use it to show that there will always be at least one power of !

It is certainly interesting to try to think about other ways in which we could solve the problem or in which we could have come to realise which numbers always remain, but we still haven’t solved the second part of the problem. So far, we have mainly used trial and error to try to construct larger tables. We need a more systematic approach.

The key insight for creating larger tables from smaller ones turns out to be the following: If we multiply each of the by some constant , then this has the effect of multiplying every entry in the table by the same constant . If two numbers in the table before were equal, then the numbers now in the same position would still be equal, and could still be deleted. Thus the same sequence of deletions could occur. We see that if the numbers that originally remained in the table were , then the numbers that remain in the new table are .

This insight is clearly useful, and we will use it to construct larger tables, but it may be very difficult to come up with it ourselves. A certain amount of luck, and previous experience with sufficiently similar problems is necessary.

Suppose that we have a sequence such that the numbers , and remain in the table at the end of our procedure. How could we create a table where a larger power of remains at the end? We could just take the current table and add a row starting with . To get a larger power of , we could add a row starting with . We could then try to add more rows to this table to try to get rid of the numbers that we don’t want. In doing so, we may realise that the sequence of deletions that we perform are very similar to the ones we performed when constructing our starting table in the first place, or we might not. We could try to find a solution this way, but the problem becomes much easier if we instead embrace our previous insight right from the onset.

If we were to multiply each of the by , for some , then we know that we would obtain a table where the numbers that remain are , and . Similarly, if we were to multiply each of the entries by instead, then we would obtain a table where the entries that remain are , and . Thus if we combine all three of the tables, we have one large table, three times the size of the original, where there is some sequence of operations that can be performed such that nine numbers remain:

We would like for only three numbers to remain, so perhaps we can choose and such that some of these numbers are equal, and hence can be deleted. We note that the only number which can be equal to is . Thus we could at least remove these two numbers by taking , and . The nine numbers that remain are then

and after removing the duplicates, we are left with just , and . We have thus constructed a larger table where only three numbers remain, and can construct infinitely many more by applying the same procedure to the new table, and the result of doing so, and so on. To be more formal, we should use mathematical induction, and should describe the new sequence more explicitly. We also have to be careful, because one of the rows in the table where we multiplied the entries by could be equal to one of the rows in the table where we multiplied the entries by . In other word, we may now have duplicate ‘s in the combined table. This is not a problem, however, because we could simply exclude these rows entirely and not change the numbers that remain at the end of the procedure. Provided that we take care when writing up the solution, we have succeeded in solving the second part of the problem.

As a follow up, which is left as an exercise to the reader, we may wonder whether the tables that we constructed above are the only possible ones where precisely three numbers remain. i.e. We could ask ourselves to find *all* values of such that only three numbers remain instead of “merely” finding infinitely many. I have not worked through this version of the problem, and so I do not know the answer, but I suspect that the answer is “yes”, and would be delighted to either see a proof, or to learn otherwise.

The South African Mathematics Olympiad problems – MathemafricaJuly 23, 2019 at 2:53 pm[…] 2018 Olympiad problem 6 […]