We all know the festive carol The Twelve Days of Christmas. Each day, “my true love” receives an increasing number of gifts. On the first day there is one gift, a partridge in a pear tree. On the second, two turtle doves and another partridge, making three. There are six gifts on the third day, ten on the fourth, fifteen on the fifth, and so on. Here is a Christmas puzzle: what is the total number of gifts over the twelve days? [TM083, or search for “thatsmaths” at irishtimes.com]

While your subconscious works on that, here is a riddle: why do mathematicians confuse Halloween and Christmas? Because 31 Oct equals 25 Dec. If this makes no sense, recall that three times eight plus one makes 25, so the octal number 31 equals the decimal number 25.

Back to the gifts: we can easily count them, but this is tedious and there is a good chance of an error. So let us reason mathematically. The number of gifts on day N is 1 + 2 + … + N, where the dots indicate that we add all numbers from 1 to N. We can check the first few values of N, and we get 1, 3, 6 and 10. In fact, there is a formula for the number of gifts on day N, namely N ( N + 1 ) / 2. Again, we can easily check that this works for the first few values of N. The numbers of gifts each day are called triangular numbers: they can each be arranged in a triangle. For N = 1 and N = 2 this is obvious. For N = 4, think of a triangle of 10 bowling pins and for N = 5 imagine 15 snooker balls arranged in a triangle.

Each day brings a greater triangular number of gifts. But how can we compute the total number without actually adding them up? We need to sum the first twelve triangular numbers. We are going to arrange them in a pile, but stacking leaping lords, laying geese and dancing ladies is inconvenient, so let us take a Christmas bauble to represent each gift. We start with twelve triangles of baubles, one for each day. We can stack the single bauble for day one on top of the three for day two. This gives a little pyramid of four baubles. We can place this on top of the six baubles representing day three to give a larger pyramid with ten baubles [see picture]. Eventually we come to the largest triangle corresponding to the gifts received on the twelfth day. Putting N = 12 in the formula given above we get ( 12 x 13 ) / 2 = 78. By all means, add up the numbers from 1 to 12 if you have any doubts.

We obtain a stack having three triangular sides and a triangular base, or four faces in total. This is called a tetrahedron. The tetrahedron is one of the five Platonic solids, known since ancient times. I will skip the details, but it is easy enough to show that the number of baubles in a tetrahedron with N layers is

N ( N + 1 ) ( N + 2 ) / 6.

Numbers of this form are called tetrahedral numbers. Plugging in the value N = 12, this comes to 364, the total number of gifts, almost one for each day of the year. True love indeed.

*        *        *        *        *        * Peter Lynch’s book about walking around the coastal counties of Ireland is now available as an ebook (at a very low price!). For more information and photographs go to RRI.