Today’s episode of My Favorite Theorem features University of Wisconsin mathematician Jordan Ellenberg. You can listen here or at We had a few audio issues in this episode, so if you missed anything, there’s a transcript here.


Ellenberg’s favorite theorem is Fermat’s Little Theorem, a not-so-little result in number theory. It states that if p is a prime number (a positive whole number that is divisible by exactly two distinct factors: itself and 1), and a is any whole number, then ap has a remainder of a when divided by p. As shorthand, mathematicians would say ap is congruent to a mod p. (Mod, short for modulo, just means the remainder when divided by a number. So the number 19 is congruent to 4 mod 5 or 1 mod 3 because it’s 4 more than 15, which is a multiple of 5, and 1 more than 18, which is a multiple of 3.)

Ellenberg stated the theorem in the special case that a=2. Then the theorem becomes the statement that when p is prime, 2p is congruent to 2 mod p, or 2has a remainder of 2 when divided by p. You can verify this easily for yourself for a few small prime numbers p: 23=8, which has a remainder of 2 when divided by 3. 25=32, which has a remainder of 2 when divided by 5, and so on.

As you’ll hear in the episode, Ellenberg relates Fermat's little theorem to the coefficients of Pascal’s triangle. This triangle (poorly named because it was studied by Persian, Indian, and Chinese mathematicians centuries before Pascal got his hands on it) shows up in a variety of different guises in mathematics. To get the entries in Pascal’s triangle, you start with a 1 by itself in row 0. (Labeling this row 0 instead of 1 makes bookkeeping a little more convenient.) Then each subsequent entry is the sum of the numbers diagonally above it.

An animation showing where entries in Pascal's triangle come from. Credit: Hersfold Wikimedia

Remembering that we start with row 0, the numbers in row n sum up to 2n.

Row 0-9 of Pascal's triangle. If you add up the entries in a prime numbered row like 3 or 7 and divide it by the row number, you will always have the remainder 2.

Ellenberg describes how you can look at the entries in prime-numbered rows and practically observe the theorem, at least for the a=2 case, falling out in front of you.

Gjetost is a caramel-colored Norwegian cheese that pairs well with modular arithmetic. Credit: Maebmij and Ranveig Wikimedia (CC BY-SA 3.0)

As a resident of Wisconsin, Ellenberg felt a duty to pair his theorem with cheese. He went with gjetost, a caramel-colored Norwegian cheese. You’ll have to listen to the episode to find out why this is the perfect match for Fermat’s Little Theorem.

You can find Ellenberg online at his website and his Twitter account @JSEllenberg. He is the author of the pop math book How Not to Be Wrong.

You can find more information about the mathematicians and theorems featured in this podcast, along with other delightful mathematical treats, at and here at Roots of Unity. A transcript is available here. You can subscribe and review the podcast on iTunes and other podcast delivery systems. We love to hear from our listeners, so please drop us a line at Kevin Knudson’s handle on Twitter is @niveknosdunk, and mine is @evelynjlamb. The show itself also has a Twitter feed: @myfavethm and a Facebook page. Join us next time to learn another fascinating piece of mathematics.

Previously on My Favorite Theorem:

Episode 0: Your hosts' favorite theorems
Episode 1: Amie Wilkinson’s favorite theorem
Episode 2: Dave Richeson's favorite theorem
Episode 3: Emille Davie Lawrence's favorite theorem