For example, frequency is an important part of a letter’s personality. e, t, and a are the three most frequent letters in English, while the most common symbols in the alien message are and , which both appear six times. Hence, and probably represent e, t, or a, but which is which? A helpful clue appears in the first word, , which has a repeated . There are few words that fit the pattern *aa* or *tt*, but there are lots of words of the form *ee*, such as been, seen, teen, deer, feed, and fees. Hence, it is fair to assume that = e. With a bit more detective work, it would be possible to unravel this particular message: Need extra cash? Melt down your old unwanted humans. We pay top dollar. And with one or two more messages the entire alien script could be deciphered from A () to Z ().

  Not surprisingly, mathematically adept Futurama fans found this alien code trivial to crack, so Jeff Westbrook (who has written for both Futurama and The Simpsons) developed a more complex alien code.

  Westbrook’s efforts resulted in reinventing the text autokey cipher, which is akin to a cipher first devised by Girolamo Cardano (1501–76), one of the greatest Italian Renaissance mathematicians. The cipher operates by first assigning numbers to the letters of the alphabet: A = 0, B = 1, C = 2, D = 3, E = 4, …, Z = 25. After this preliminary step, encryption requires just two more steps. First, each letter is replaced with the numerical total of all the letters in all the words up to and including the letter itself. Hence, BENDER OK is transformed as follows:

  Letter

  B

  E

  N

  D

  E

  R

  O

  K

  Number

  1

  4

  13

  3

  4

  17

  14

  10

  Total

  1

  5

  18

  21

  25

  42

  56

  66

  The second and final encryption step involves replacing each total number with the corresponding symbol from this list:

  There are only 26 symbols, which are associated with the numbers 0 to 25, so what symbol represents R, O, and K, which have just been assigned totals of 42, 56, and 66, respectively? The rule23 is that numbers bigger than 25 are reduced by 26 again and again until they are in the range 0 to 25. Hence, to find the symbol for R, we subtract 26 from 42, which leaves us with 16, which is associated with . By applying the same rule to the remaining two letters, BENDER OK is encrypted as .

  However, if it was preceded by some other words, then BENDER OK would be encrypted differently, as the running total would be affected. This made Westbrook’s autokey cipher fiendishly difficult to crack. He used it to encode various messages across several episodes, and they proved to be a serious challenge to those Futurama fans who made a hobby out of cracking the codes that appeared in the series. Indeed, it took a year before anybody cracked the exact details of the autokey cipher and decoded the various messages.

  Although one might expect some challenging codes to appear in the Futurama episode “The Duh-Vinci Code” (2010), its most interesting mathematical aspect relates to a completely different area of mathematics. The plot involves the Planet Express team analyzing the fine detail of Leonardo da Vinci’s painting The Last Supper, whereupon they notice something odd about James the Lesser, one of the apostles sitting at the left end of the table. A high-powered X-ray reveals that da Vinci originally painted James as a wooden robot. In order to find out whether or not James was an early automaton, the crew heads to Future-Roma, where they discover St. James’s tomb. Importantly, they also stumble upon a crypt with an appropriately cryptic engraving that reads:

  IIXI – (XXIII • LXXXIX)

  At first sight, the Roman numerals look rather like a date. On closer inspection, however, we can see that the engraving includes parentheses, a subtraction sign, and a dot that represents a multiplication sign. We even have the highly unusual arrangement of one Roman numeral raised to the power of another Roman numeral (IIXI). If we convert all these Roman numerals to more familiar digits, we can begin to make sense of the inscription:

  IIXI – (XXIII • LXXXIX)

  211 – (23 × 89)

  Now, 211 = 2,048 and 23 × 89 = 2,047, so the result of this subtraction is simply 1. This is not particularly noteworthy, but if we complete the equation and rearrange it slightly, then it might begin to look familiar:

  211 – (23 × 89)

  =

  1

  211 – 1

  =

  (23 × 89)

  211 – 1

  =

  2,047

  We can now see that the number 2,047 fits the general form 2p – 1. p is 11 in this particular case, but p can be any prime number. The number recipe 2p – 1 was discussed in chapter 8, where it was pointed out that it uses one prime number as an ingredient in order to sometimes generate a second prime number, in which case the resulting prime is dubbed a Mersenne prime. However, 211 – 1 is interesting, because the result, 2,047, is clearly not prime, but rather it is the product of 23 and 89. Indeed, 2,047 is notable as the smallest number of the type 2p – 1 that is not prime.

  This reference fulfills two of the key criteria required to qualify as a classic freeze-frame gag. First, the cryptic inscription has no bearing whatsoever on the plot, but is merely an instance of the writers having fun with numbers. And, second, it is impossible to jot down the Roman numerals, translate them into decimals, and then recognize their significance within the few moments that the inscription is in view.

  Another freeze-frame gag appears in “Put Your Head on My Shoulders” (2000). When Bender sets up a computer dating agency, we see a sign pointing out that his service is both “discreet and discrete.” Discreet implies that Bender will respect his clients’ privacy, as we might expect from such agencies. Discrete is a more surprising adjective for a dating agency, because it is used in mathematical circles to describe an area of research that deals with data that does not vary smoothly or continuously. Pancake flipping is one area of discrete mathematics, because it is possible to consider one flip or two flips, but not one and a half or any other type of fractional flip. This freeze-frame gag was possibly inspired by an old joke about discrete mathematics:

  Q:

  What do you call a mathematician who has lots of romantic liaisons, but who doesn’t like to talk about it?

  A:

  A discrete data.

  Other Futurama freeze-frame gags relate to signs, such as the one at Studio 1²2¹3³ in “Rebirth” (2010). If we work out the result, then 1²2¹3³ = 1 × 2 × 27 = 54, so this is a reference to Studio 54, the famous 1970s New York nightclub. Similarly, we glimpse a sign that reads “Historic √66” (instead of “Historic Route 66”) in “Parasites Lost” (2001), and there is the irrationally named πth Avenue in “Future Stock” (2002).

  Although it is tempting to look at all these mathematical quips and consider them superficial, in many instances the writers have thought long and hard about the underlying ideas. Madison Cube Garden, which appears in several episodes of Futurama, is a case in point. When David X. Cohen invented the concept of a thirtieth-century incarnation of New York’s Madison Square Garden, the next step was to think about how it would be drawn in the Futurama landscape. The obvious design would have been a cubic stadium, with a base, four walls, and a flat glass roof. However, Ken Keeler and his fellow writer J. Stewart Burns decided to investigate the geometry of cubes to see if there was a more interesting option for the orientation and design of Madison Cube Garden. In the end, they took this question so seriously that they spent a couple of hours studying the geometry of cubes while the rest of the writing team took a break.

  Without much thought as to where it would lead, Burns and Keeler began to wonder what cross sections might be possible if they could take a slice through a cube. For example, a horizontal slice, which splits the cube into two equal parts,
results in a square cross section. By contrast, a slice that starts at a top edge and runs to the diagonally opposite edge forms a rectangular cross section. Alternatively, lopping off a corner creates a triangular cross section. Depending on the angle of the slice, the cross section might be an equilateral, isosceles, or scalene triangle.

  Still driven by mere curiosity, Burns and Keeler wondered if a more exotic cross-sectional shape might be possible. The duo set aside their sketchpads and set to work building paper cubes, only to chop them up again. After much debate and crumpled paper, Burns and Keeler had a revelation. They eventually realized that it was possible to create a hexagonal cross section by taking a single slice through a cube at a particular angle. It sounds implausible, but imagine drawing a line between the midpoints of two adjacent edges, as shown by a dashed line on the cube below. Next, draw a dotted line across the opposite corner of the opposite face. Finally, take a slice from the dashed line through to the dotted line and the result will be a regular hexagonal cross section. The cross section has six sides, because the slice passes through all six faces of the cube.

  There is another way to obtain this cross section. Imagine suspending a cube from a piece of cotton attached to one of its corners. Then make a slice horizontally, exactly halfway down the dangling polyhedron. If the cube could somehow remain intact after the slice . . . and if it could be gently lowered onto a surface . . . and if its lowest corner could be embedded in that surface, then you would have an almost perfect model of Madison Cube Garden. To complete your model, the region above the cross section becomes a transparent roof, while the region below provides an appropriate arrangement for raked seating.

  In the years since Cohen named the stadium and the Burns-Keeler partnership created its unique geometric architecture, Madison Cube Garden has been home to Ultimate Robot Fighting League matches, giant ape fights, and the 3004 Olympic Games. In fact, Madison Cube Garden has appeared in ten episodes, making it probably the best known piece of mathematics in Futurama, but not the most intriguing.

  That prize goes to the number 1,729.

  CHAPTER 15

  1,729 and a Romantic Incident

  Futurama’s Zapp Brannigan is a twenty-five-star general and captain of the starship Nimbus. Although he has many adoring fans, who view him as a courageous military hero, the reality is that most of his victories are against lesser opponents, such as the pacifists of the Gandhi Nebula and the Retiree People of the Assisted Living Nebula. Brannigan is essentially a buffoon whose vanity and arrogance annoy his crew. Indeed, his long-suffering assistant Lieutenant Kif Kroker struggles to hide his disdain for his incompetent leader.

  Kif is an alien from the planet Amphibios 9, and his appearances in Futurama often revolve around his dysfunctional relationship with Brannigan or his ongoing romantic relationship with Planet Express’s intern, Amy Wong. Whenever Kif and Amy are in the same space neighborhood, they make the most of being able to spend time together. In “Kif Gets Knocked Up a Notch” (2003), Amy visits Kif on board the Nimbus, where he takes her to the holo-shed, which is used to simulate realities by projecting three-dimensional holographic objects and creatures. She squeals with delight when a familiar animal appears in the holo-shed.

  AMY:

  Spirit! Kif, that’s the pony I always wanted, but my parents said I had too many ponies already.

  KIF:

  Yes, I programmed it in for you. Four million lines of BASIC!

  We have already encountered a joke that relies on a knowledge of the BASIC computer programming language, in the episode titled “I, Roommate.” Although references to computer science are a tradition within Futurama, there was one non-nerdy writer who did not appreciate this particular line of dialogue. During a script meeting, he argued that the reference to “four million lines of BASIC!” was too obscure and should be removed. As soon as this criticism was raised, it was robustly quashed by Eric Kaplan, a writer who had studied the philosophy of science. As Patric Verrone, who was at the meeting, recalls: “There was a very famous remark made by Eric Kaplan. Somebody said ‘Four million lines of BASIC, who’s going to get that?’ And Kaplan just said, ‘Fuck ’em,’ to coin a phrase. And so that became the mantra. If viewers don’t get it, they’ll get the next joke.”

  In the same episode, there is an even more obscure mathematical reference, which can be seen on the side of the Nimbus. Keen-eyed, obsessive fans will have spotted that the Nimbus displays the registry number BP-1729. It would be easy to dismiss this as an arbitrary number, but the Futurama writers never miss an opportunity to celebrate mathematics, so it is safer to assume every number that appears on screen is significant.

  Indeed, 1,729 must be significant because it crops up in different situations in various episodes. For example, in “Xmas Story” (1999), there is an appearance by Mom, the Machiavellian owner of MomCorp and Mom’s Friendly Robot Company. As Mom owns the factory that built Bender, she considers herself to be Bender’s mother, so she sends him a card that reveals his serial number:

  Moreover, in “The Farnsworth Parabox” (2003), the Planet Express crew becomes embroiled in an adventure involving parallel universes, with each universe conveniently contained in a box and labeled with a number. While checking several boxes in order to find his own universe, Fry jumps into a box and finds himself in Universe 1,729.

  So, what makes 1,729 so special? Perhaps it keeps cropping up in Futurama because it points to a special part of the number e. If we pinpoint the 1,729th decimal place of e, then we discover that it marks the start of the first consecutive occurrence of all ten digits in this famously irrational number:

  Some might consider this a trivial observation, so perhaps 1,729 features in Futurama because it is a harshad number, a category of number invented by the respected Indian recreational mathematician and schoolteacher D. R. Kaprekar (1905–86). Harshad means “giver of joy” in the ancient Indian language Sanskrit, and the reason these numbers generate a sense of bliss is that they are multiples of the sum of their digits. So, by adding up the digits of 1,729, we get 1 + 7 + 2 + 9 = 19, and indeed 19 divides into 1,729 with no remainder.

  Moreover, 1,729 is a particularly special type of harshad number, because it is the product of the sum of its digits and the reverse of this sum: 19 × 91 = 1,729. This makes it a remarkable number, but not unique, because there are three other numbers that share this property: 1, 81, and 1,458. Since the writing team is not obsessed with 1 or 81 or 1,458, there must be another reason why the series repeatedly features 1,729 in its scripts.

  In fact, the writers chose 1,729 as Nimbus’s registry number, Bender’s serial number, and the label for a parallel universe because it was mentioned in one of the most famous conversations in the history of mathematics. It took place in late 1918 or early 1919 between two of the greatest mathematicians of the twentieth century, Godfrey Harold Hardy and Srinivasa Ramanujan. It is hard to imagine two men from such different backgrounds with so much in common.

  G. H. Hardy (1877–1947), whose parents were both teachers, grew up in a middle-class home in Surrey, England. At the age of two he was writing numbers that reached into the millions, and a little later he calculated the divisors of hymn numbers in order to amuse himself during church services. He won a scholarship to the prestigious Winchester College and then attended Trinity College, Cambridge, where he joined an elite secret society known as the Cambridge Apostles. By the time he was thirty, he was one of the few British mathematicians considered world class. Indeed, at the start of the twentieth century, it was felt that the French and Germans, among others, had leapfrogged the British in terms of their mathematical rigor and ambition, but Hardy’s research and leadership was credited with revitalizing his nation’s reputation. All of this would have been sufficient to earn him a place in the pantheon of great mathematicians, but he made an even greater contribution by recognizing and nurturing the talent of a brilliant youngster named Srinivasa Ramanujan, whom he believed to be the most naturally gifted mathe
matician of the modern era.

  Ramanujan was born in 1887 in the South Indian state of Tamil Nadu. At the age of two he survived a bout of smallpox, but his three younger siblings were less fortunate, each one dying in infancy. His impoverished parents devoted themselves to their only child and enrolled him in the local school. As each year passed, his teachers increasingly noticed that Ramanujan was developing a tremendous aptitude for mathematics, so much so that they were unable to keep up with him. Much of his inspiration and education came as a result of stumbling upon a library book, A Synopsis of Elementary Results in Pure Mathematics, by G. S. Carr, which contained thousands of theorems and their proofs. He investigated these theorems and the techniques used to prove them, but he had to perform the bulk of his calculations with a chalk and slate, using his roughened elbows as erasers, as he was unable to afford paper.

  The only downside to his obsession with mathematics was that it led him to neglect the rest of his schooling. Hence, when it came to examinations, he performed poorly in these other subjects, which meant that Indian colleges refused to offer him the scholarship he needed to be able to afford to continue with his studies. Instead, he found a job as a clerk and supplemented his meager income by tutoring mathematics students. The additional money was desperately needed after he got married in 1909. Ramanujan was twenty-one and his new bride, Janakiammal, was just ten years old.