"People have written about the philosophy, theology and politics of The Simpsons, and you can do the same with Coronation Street, or 24.

“But you won’t find the mathematics of The Simpsons anywhere else – you can’t talk about the maths of Benny Hill or Are You Being Served? It’s what makes it unique.”

It was while he was watching an episode of The Simpsons entitled The Wizard Of Evergreen Terrace ten years ago that science writer and broadcaster Simon Singh first made the connection between Springfield’s most famous family and mathematics.

“In that episode Homer wanted to become an inventor,” recalls Singh, who is coming to Brighton Science Festival to talk about his new book The Simpsons And Their Mathematical Secrets.

“I saw on the blackboard there was a real equation relating to Fermat’s Last Theorem.”

Singh’s first published work was a history of the notorious problem so the equation jumped out at him.

“I started looking into who was putting these things in,” says Singh.

One of the major culprits was David X Cohen – head writer for The Simpsons and co-creator with Matt Groening of the sci-fi animation Futurama.

“Cohen has written mathematical research papers,” says Singh. “Another guy was a professor at Yale, another from Harvard worked at [mobile phone company] AT&T. They left very promising careers in order to pursue this other life in comedy on the world’s most successful TV show.”

As well as interviewing some of the scriptwriters, Singh scoured DVDs of both The Simpsons and Futurama, watching the episodes and listening to commentaries.

“There are odd bits of maths like pi and Pythagoras’s Theorem that crop up in the middle of stories,” he says. “But the most interesting maths is hidden in the background – people who don’t know maths wouldn’t spot it.

“One Futurama writer Ken Keeler invented a new form of maths to resolve a plot point in an episode where the characters were swapping minds and bodies so they could all swap back to the right body. The proof appears on screen on a blackboard in the background.

“The writers love maths, and if you’re a teenager who loves maths and The Simpsons it’s a real encouragement to pursue that interest further. The writers like to look at themselves at that age and think how cool it would have been to spot Euler’s Identity in a TV show."

The move from maths into comedy isn’t limited to The Simpsons. Stand-up comics Dave Gorman, Dara O Briain, Paul Foot and Romesh Ranganathan all studied maths to a high level.

Perhaps the most famous mathematician-turned-comic was MIT and University Of California lecturer Tom Lehrer. His piano-driven darkly comic songs mixed satirical swipes at America in the 1950s and 1960s with an attack on New Math and perhaps his most famous composition The Elements listing the whole of the Periodic Table.

“There’s a link between comedy and maths, but there’s no clear answer,” says Singh.

“Perhaps it’s the love of playing with logic, bending and breaking it, which can lead to humorous results. There’s a technique in maths called reductio ad absurdium, which is proof by contradiction. Using this method, if a mathematician wants to prove something is true they pretend it isn’t and follow the logic of that path – which hopefully comes to a conclusion which is utterly absurd.”

It was television which encouraged Singh to explore the world of science and maths.

But he worries that a new generation is being let down by the current education system.

“Science on television is definitely booming,” says Singh, who spent his early television career as a producer and director on Tomorrow’s World and Horizon.

“There is a real audience for it – the real issue is what we are teaching in schools. Are we really allowing students to leave school feeling confident in maths? Equally as important – are we stretching them and giving them a springboard into studying maths and science at university?”

Sadly Singh believes the answer to both questions is no.

“The school curriculum isn’t designed to build a new generation of mathematicians, scientists and engineers,” he says. “The GCSE is one-size fits all, it doesn’t prepare students for what an A Level is going to be like. The curriculum is still fairly useless for people who have ambition.”

Singh is a member of the Advisory Council for the Campaign For Science And Engineering, promoting science and engineering in the UK, but he is frustrated by the inaction of education secretaries over the years.

“Over the past 25 years I don’t see any signs of improvement,” he says, adding he is calling for a GCSE Plus exam to bridge the gap between GCSE and A Level maths and science. “We have had a boom in science on television and with the growth of science festivals, but we are still turning out students who aren’t really prepared for university. It’s almost a tragedy to excite and inspire a child who will go back to a school curriculum that will not inspire.”

  • Simon Singh: The Simpsons And Their Mathematical Secrets, Sallis Benney Theatre, Grand Parade, Brighton, Saturday, March 1
  • Starts 8pm, tickets £7/£4. Visit www.brightonscience.com