## The Twelve Days of Christmas and Tetrahedral Numbers

(Edit, 12/5/07: I guess it’s that time of year again, isn’t it? =) I’ve started to see a lot more traffic to this post in the last few days. For anyone finding me through a Google search, I wanted to note that this was actually the first post in a seven-part series, and you can read the rest of the series here: computing tetrahedral numbers, triangular numbers, binomial coefficients,
a solution to the triangular number challenge, pascal’s triangle, and the conclusion tying everything together.
)

On the first day of Christmas, my true love gave to me…

Thus the opening words to the popular Christmas song. In case you don’t know it (hey, it’s possible), it concerns an individual who recounts, in obsessive detail, a catalogue of gifts received from their “true love”. It is a matter of some speculation whether the “true love” bit is intended as sarcasm, for reasons we shall soon see. At any rate, on each of the twelve days of Christmas the “true love” gives the narrator all the same gifts as on the previous day, plus a new gift item in a quantity determined by the number of days since the start of Christmas. For example, on the fifth day, the narrator receives five golden rings, four calling birds, three french hens, two turtle doves, and a partridge in a pear tree. (Or five onion rings, four calling cards, three french fries, two turtle necks, and an MC Hammer CD, depending on which version of the song you know.) This song raises several interesting questions, including “What the heck is a turtle dove?” and “Who does that?” More to the point of this post, however, it also raises the question, “So, how many gifts IS that!?”

These numbers are known as triangular numbers, due to the fact that they can be represented pictorially by dots arranged in triangles. Like this:

It shouldn’t be too hard to see that the number of dots in the nth triangle above corresponds to the sum of the integers from 1 through n (just count the number of dots in each row). Can you find a pattern and come up with a way to quickly figure out the nth triangular number, without having to add up all the numbers from 1 to n? (More on this in the next post.)

Of course, we’re not ultimately interested in how many gifts the narrator received on each day by itself; we want to know how many gifts the narrator got in total. Well, after the first day the narrator had one gift; after the second day, 1 + 3 = 4 gifts; after the third day, 1 + 3 + 6 = 10 gifts; and so on. In general, the total number of gifts after the nth day is just the sum of the first n triangular numbers: 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364.

These are known as tetrahedral numbers, since they can be represented pictorially by dots arranged in tetrahedra (i.e., triangular pyramids). Like this:

Do you see why? Each “layer” of a tetrahedron is a triangle of dots representing a triangular number: hence each tetrahedron is a sum of triangular numbers. The twelfth tetrahedral number, 364, tells us how many gifts our narrator received in total. 364 gifts is a lot. And with all those geese running around laying eggs everywhere, the continual racket from the drummers, and so on, I’m not sure I’d really want them.

So, we’ve learned about triangular numbers and tetrahedral numbers, and that the total number of gifts received by the narrator of the song corresponds to a tetrahedral number. But what if there were 144 days in Christmas instead of 12? How many gifts would our intrepid narrator receive then? Easy, you say, it’s the 144th tetrahedral number! Well, true, but what is that number? We don’t yet know a quick way to figure that out other than just adding everything up — but for a number as big as 144 that would be incredibly tedious (not to mention that we’d probably make a mistake). It turns out there is a quick way to figure it out — but that will have to wait for the next post!

Associate Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in famous numbers, games, geometry, sequences. Bookmark the permalink.

### 17 Responses to The Twelve Days of Christmas and Tetrahedral Numbers

1. Matthew says:

I hate math! I love this explanation though. Over at another website a teacher posted a word problem that asks how many gifts the narrator recieves in the 12 days fo Christmas. This teacher swears it is 78. I diagreed and am thrilled to find out the answer.

Now for a historical question. Or maybe it’s theoretical. Why did the narrator recieve 364 gfts? Is there a symbollic reason for the number 364 besides this mathematical tetrahedral explanation? At first I thought it had something to do with the number of days in a year…but it doesn’t…ever. Even way back in the day the years had 366 days. So now I am left with a quandary. What does the number 364 have to do with Christmas?

2. Brent says:

Hi Matthew, I’m very sorry to hear that you hate math! Perhaps you’ll let me try to change your mind? Be sure not to confuse hating your math teacher(s), math classes, and so on with hating math itself! =)

At any rate, 78 is the number of gifts that the narrator receives just on the 12th day of Christmas, as you can easily check for yourself: 1 partridge + 2 turtle doves + 3 french hens + … + 10 + 11 + 12 = 78. As for the number 364, I’m really not aware of any special historical meaning there. On day n, the narrator gets everything they got yesterday, plus n of a new gift… which makes for a nice, simple, logical song structure, don’t you think? And if you add all that up, you just happen to get 364. I don’t think you need to look any further for special significance of the number 364. In other words, I think someone made up the song and the total gifts happened to be 364… NOT that 364 had some special significance and so someone made up the song to match. You’d have a very difficult time coming up with such a simple, logical song for which the total number of gifts came out to be, say, 365.

It certainly is an amusing coincidence, however, that the total number of gifts comes out to a number so close to the number of days in a year! I hadn’t even thought of that.

3. Judy Segina says:

Have you ever seen this put into a lesson plan connecting it to Gauss. I’d love to use it before Christmas and include the historical tie-in. Any ideas?

4. Brent says:

Hi Judy,

This post was actually the first in a seven-part series, which continues with posts on computing tetrahedral numbers, triangular numbers, binomial coefficients,
a solution to the triangular number challenge, pascal’s triangle, and the conclusion tying everything together. I actually do talk about Gauss in the “triangular numbers” post.

Anyway, there’s definitely lots of great stuff here for a lesson or two before Christmas — sounds like a good idea to me. You could probably just start by posing the question of how many total gifts the narrator receives in the song, and then once your students figure that out, start prompting them to generalize it in various ways, and go from there. Feel free to steal any and all ideas from my blog — all I ask in return is that you tell your students about it if you think they’d be interested!

5. Fred Johnson says:

The number of any gifts for number, n, can be found by the simple formula:

Sn = n(n+2)(n+1)/6

If you would like to see how I derived this, drop me a line at
johnson.fred.w@gmail.com

6. Fred Johnson says:

My previous comment probably comes out in the other posts, but if not, here you have it. Actually it was interesting to do because I use an integral over a discrete function with an error function of n. Since my expression for the number of gifts on any given day is parabolic (i(i+2)/2 where i is the day in question), the error will take the same form also.

7. Sara Joy says:

WOW!! This is VERY interesting. I first heard of this Twelve Days equation while I was on Wikipedia and it intrigued me. I decided to research this more and I came across this site. Amazing!

I am a multimedia major and I am in the process of writing a Christmas Program for my church. Upon learning about a literal mathematical equation, I quickly got inspired to write a comedy sketch about this subject. I believe this will be funny yet informative. Thanks taking the time to write this article. Have an early Merry Christmas!

8. Brent says:

Hi Sara, thanks! Glad you were inspired! Good luck with the Christmas program.

9. Phil Castoro says:

The sum of the number of gifts, G, is:
G = 1 + (1+2) + (1+2+3) + … (1+2+3+…12) = 364

Below is how I found it. I used the sum of the first n integers formula twice and the sum of the first n squares once. I think this approach actually makes for a nice lesson.

We know the sum of (1…n) is n*(n+1)/2 (or we can prove it quickly with induction or some other combinatorial argument).
For this problem, note we have a sum of that form FOR EACH DAY.

That is, altogether, we have:

G = SUM {k*(k+1)/2} for k=1…12
G = SUM (1/2) {(k^2)+ k} for k=1…12

Now we also know the sum of the first n squares = (1+ 4 + 9…+ n^2) is given by n*(n+1)*(2n+1)/6. (Again, you can use induction or something more clever or just look it up.)

Pulling out the half, we have:
G = (1/2)* {n*(n+1)*(2n+1)/6}+ (n)(n+1)/2]

There are 12 days of Christmas so n=12.
G = (1/2) {12*13*25/6 + 12(13)/2}
G = (1/2) {650 + 78}
G = 364

Phil Castoro

10. Patrick says:

Here’s an even cooler way.

The number of gifts on the first day is 3 pick 2 (combinatorics). This is the same as the n(n+1)/2 formula. The second days is 4 pick 2 and the nth day is n+1 pick 2.

So the sum we’re looking for is 3 pick 2 + 4 pick 2 +… +13 pick 2 WHICH, by the hockey stick identity, is just 14 pick 3.

Which is equal to 14*13*12/6=364

11. John says:

I think the sum of 364 is not coincidental and is part of the beauty of the song. Christmas is closely tied to the solstice and the celebration of the New Year. One way to look at is a gift for every day of the year following Christmas. However, I prefer to think it is 364 gifts plus one additional unspoken gift that there is only one of–love itself, the true love himself, a wedding proposal….