The tetrahedral days of Christmas
November 25, 2024 at 11:13 AM by Dr. Drang
I’m pretty sure there’s a Peanuts comic strip in which Linus works out how many of each gift was given in the “Twelve Days of Christmas.” I’ve been unable to Google it, because the search results are overwhelmed by links to “A Charlie Brown Christmas.” So I decided to work it out myself.
It’s obvious that there are 12 partridges in a pear tree, one for each of the 12 days. And it follows that there are 22 turtle doves, two for each of the 11 days after the first. By induction, we can say that the total number of the kth gift is
Here’s a table of the results:
Gift no. | Gift | Total |
---|---|---|
1 | Partridge in a pear tree | 12 |
2 | Turtle doves | 22 |
3 | French hens | 30 |
4 | Calling birds | 36 |
5 | Gold rings | 40 |
6 | Geese a-laying | 42 |
7 | Swans a-swimming | 42 |
8 | Maids a-milking | 40 |
9 | Ladies dancing | 36 |
10 | Lords a-leaping | 30 |
11 | Pipers piping | 22 |
12 | Drummers drumming | 12 |
Adding up twelve numbers is easy, especially since the symmetry lets you add just the first six and double it. But let’s work out a formula. We start with
which we can break into two parts:
or
The first of these sums is our friend the triangular number,
which we saw in the post on houses of cards. For , the triangular number is
The second sum comes from a 3D analog to the triangular numbers, the square pyramidal numbers,
The name comes from building a pyramid of balls with a square base. The top row has just one ball; the row under it has four; the row under that has nine, and so on. The kth pyramidal number is the total number of balls in a pyramid with n rows. For , the square pyramidal number is
So our total gift count is
which is coincidentally close to the number of days in a year.
We could have kept the formulas algebraic and worked out a single simple formula for the total number of gifts:
This turns out to be a tetrahedral number. Tetrahedral numbers are also called triangular pyramidal numbers; they’re similar to the square pyramidal number but with a triangular base instead of a square.
After working it out, this answer seems obvious in retrospect. It comes from adding the gifts day-by-day instead of gift-by-gift. On the first day, there’s one gift (a partridge); on the second day, there are three gifts (two calling birds and a partridge); on the third day, there are six gifts (three French hens, two calling birds, and a partridge). Each day, you add the next triangular number, which is exactly how the tetrahedral numbers are constructed.
After doing this, I looked up tetrahedral numbers in the Online Encyclopedia of Integer Sequences. It’s sequence A000292, and one of the examples given in the comments is “the number of gifts received from the lyricist’s true love up to and including day n in the song ‘The Twelve Days of Christmas.’” Doing that first would’ve saved me some time, but wouldn’t have been any fun.