Although many episodes contain mathematical "in jokes", from the point of view of mathematical fiction, the most notable episode of Futurama was "The Prisoner of Benda" (2011). In that episode, a machine which exchanges minds between two bodies is created, and only after it has been used they discover that the machine can only exchange the minds of a given pair of individuals once. In response to Amy's question about whether it will be possible to return to their original bodies, the Professor answers (ominously) "We will have to use....math!" In the middle of the episode there is a reference to a "reverse Turing test" for determining if a being in a human body is actually a robot, but the real mathematics shows up later. Towards the end, two Harlem Globetrotters prove a theorem at the board (a result about permutations) guarantees that there will be a way to restore all individuals to their original bodies provided two additional individuals who have not previously used the machine are available. (The professor makes a comment about pure math finally finding a real application.)
In fact, regular Futurama writer Ken Keeler really proved such a theorem in preparing the episode. (See The Infosphere for more information.) This makes "The Prisoner of Benda" very interesting to me. I know of many works of fiction that include references to a real mathematical result that existed before, and many that include references to imaginary mathematical results created specifically for inclusion in the work of fiction. At the moment, however, I am not aware of any other examples of a real mathematical result created only for inclusion in a work of fiction. (Many thanks to Lauren Tubbs for bringing "The Prisoner of Benda" to my attention.)
For an overview of mathematics in the series Futurama, see Sarah Greenwald's website Futurama Math and her recorded lecture lecture "Bite My Shiny Metal X".
