The Duh-Vinci Code is the fifth episode of the sixth season of Futurama. Fry finds blueprints to Da Vinci's lost invention. Bender steals The Last Supper, which hides a surprising secret.
Fry has a habit of failing to think before speaking, which got him ejected from Who Dares to Be a Millionaire. After initially berating him, the Professor shows him his inspirations for intelligence: statues of histories' greatest minds. Among them is Leonardo da Vinci. Fry accidentally destroys da Vinci's beard, which Farnsworth purchased at an auction, revealing plans for an unknown device that da Vinci had devised. Fry offers to help solve it, to which the Professor laughs at him. Fry then leaves Planet Express, contemplating his IQ, when he was hit by a bus. He spends two weeks in the hospital, at which no one visited him or even sent a card. When he returns to the company, Farnsworth is in the midst of trying to solve the mystery of da Vinci's device. He sent Bender to retrieve a copy of the Last Supper, but the robot had stolen the real mosaic. Examining it, they notice that there is a hand on the painting that doesn't belong to anyone, holding a knife pointed at St. James and beneath him at a strange pair of wooden table legs. Using a high-powered x-ray, they discover that St. James was actually a robot. Realizing that they've come over a three thousand year old mystery, Farnsworth declares that they must go to Rome to figure this out; Hermes tries reminding him that they are just a delivery company, but is ignored.
The Planet Express crew races to future Rome and discover St. James' coffin, confirming that he was actually a robot. Bender tries to pry out his jeweled eyes, only for a mouse to hop onto a wheel embedded in his chest cavity and starts running, causing the wooden robot to reactivate. The robot, named Animatronio, explains that he had actually tossed away the real St. James, to await Leonardo's "Shadow Society of Intellectuals". The crew then starts prodding him with questions about Leonardo's mysterious invention. Animatronio recognizes the device as the "Machina Magnifica" but seeing as none of the crew are members of the Shadow Society, he refuses to reveal anything, and begins to flay himself to death when he mentions a fountain. Leela is able to intimidate him into confessing about the fountain, before he spontaneously shuts down. The Professor thinks to quickly give up, before hitting on the epiphany that Animatronio was talking about the Trevi Fountain, deducing the clues from a statue of Neptune. However, the fountain is guarded by an octopus. Bender, determined to collect the coins in the fountain, kills the octopus. He then pulls a giant nickel from the very bottom, only to discover that it is in fact a plug, at which the fountain begins to drain.
The others leap down the tube after Bender, discovering that the tube lead to the Pantheon, fit with a statue of the Vitruvian Man. Meanwhile, a figure in the shadows tries shooting a dart at the Professor, only to miss and hit Bender in the side of his eye, which he doesn't notice. Finding a coin slot which the giant nickel could fit in, Bender attempts to tie it to a string to pull it out, only for his right arm to be pull off. The statue then starts to roll across the floor, which begins to retract to reveal da Vinci's secret workshop. Fry asks if any of these actually work, to which Farnsworth says they don't. Then suddenly, the mysterious figure, revealed to be Animatronio, throws a mace at them, only for it to attach itself to Bender's shoulder, which he uses to whack Animatronio. When they try interrogating him again, he accidentally let slip that many of that many of DaVinci's famous inventions actually fit together, before pretending to die. Fry tries one of the flying craft, determining that it can't fly. Farnsworth warns him that that's dangerous, only to be thrown around by the antiquated machinery onto the chair next to Fry. They soon learn that the craft they're in is in fact a spaceship. Animatronio makes once last ditched effort to stop them from discovering da Vinci's greatest secret with a giant crossbow, only to be tackled by Leela and Bender. The crossbow then fires its arrow at the activation lever, launching Fry and Farnsworth into space.
It takes a month before they arrive at their destination: Vinci, a planet full of a mix of advanced and steam-based technology. Also, they discover Leonardo, who was in fact a near-immortal alien who came to Earth because he was actually the dumbest of his kind. He is belittled by everyone for not being smart enough to use their civilization's more advanced technology. He could only find solace in inventing, until he lost the designs for the Machina Magnifica, which Fry had on his person the whole time. While the Professor goes to check out the math hall, Fry helps Da Vinci build his lost invention. However, he soon learns that it is not only an ice cream machine, but a doomsday device, designed to slay all the others who have tormented Leonardo over the years. Farnsworth steps up to join him, shouting that though he's stupider than his people, doesn't mean they're smarter than him. Leonardo then unleashes his doomsday machine on everyone. Fry, refusing to let this happen, attempts to nail a nail with another nail to sabotage the machine, only for it to hit him in the eye and cause him to fall into the machine. As he is jammed between gears, he stops the machine. Once again everyone begins to mock Leonardo, who then attempts to restart his machine, only to be crushed by a large gear. Farnsworth and Fry (who is more injured than his last incident) take Leonardo's ship back home. Farnsworth apologizes to his uncle for mistaking his intellect, only to incidentally insult him once again.