Just out with the book The Simpsons and Their Mathematical Secrets, Simon Singh writes in The Guardian about the popular cartoon's mathematically-sophisticated writers—and the math jokes you might miss if you don't keep a sharp eye out and a finger on the pause button.
Singh catalogs sightings of narcissistic numbers, Euler's identity, googolplex, a pseudo-solution to the equation Fermat's Last Theorem claims is unsolvable...
Perhaps more interesting, though, is hearing the show's writers compare doing mathematics to crafting Simpsons content. According to David X Cohen:
The process of proving something has some similarity with the process of comedy writing, inasmuch as there's no guarantee you're going to get to your ending. When you're trying to think of a joke out of thin air (that also is on a certain subject or tells a certain story), there's no guarantee that there exists a joke that accomplishes all the things you're trying to do…and is funny. Similarly, if you're trying to prove something mathematically, it's possible that no proof exists. And it's certainly very possible that no proof exists that a person can wrap their mind around. In both cases—finding a joke or proving a theorem—intuition tells you if your time is being invested in a profitable area.