FANS of cult TV series The Simpsons were given exclusive access to its secret mathematical world after a new book was launched at a Caerphilly secondary school yesterday.

Author Dr Simon Singh launched The Simpsons and their Mathematical Secrets at Pontllanfraith Comprehensive School, near aptly named Springfield.

Dr Singh, ex-CERN physicist and number one bestselling author of Fermat’s Last Theorem, explained how seemingly random numbers and formulas featured in some episodes are actually some of the most complicated form of mathematics.

The Simpsons is the most successful show in television history, with 27 prime time Emmy Awards.

But most people are unaware that its writing team is bristling with maths PhDs, and the series contains enough maths to form a university course. Dr Singh said: “The Simpsons is full of maths.

“I first spotted the maths in it when I was writing my book on Fermat (a numerical theory) and as I looked deeper into it, I came across a hardcore, underground community who were also looking into it.

“I met with the writers last year to talk about it in further detail.

“It’s a show for kids, but it’s also very much for adults – although you wouldn’t know it.”

Year 10 and 11 pupils from surrounding schools were also in attendance at the book launch, with six lucky students handed a signed copy of the book.

Tim Williams, head teacher at Pontllanfraith Comprehensive, said: “We feel very privileged that Mr Singh came to our school.

“It was very inspiring for the children.”