Teen film heroes tend to look like Robert Pattinson. Or Taylor Lautner. They are chiselled. They are brooding. They are not, on the whole, good at maths.
A new film, however, aims to change that. It hopes to do for the International Mathematical Olympiad what the Twilight series did for vampires.
X+Y, which is released in cinemas today, tells the story of Nathan, a talented maths pupil who is on the autistic spectrum. Mentored by his unconventional teacher, Mr Humphreys, Nathan is invited to compete at the Olympiad in Taiwan. On the way, he falls for Zhang Mei, one of the Chinese competitors, a development that tests his devotion to algebraic equations.
Morgan Matthews, the film's director, first came across the International Mathematical Olympiad when he was commissioned to make a documentary about its teenage contestants. "I met some extraordinary people," he said. "They were all just such vivid and unique characters. Some were also on the autistic spectrum. They were finding some aspects of life quite difficult at that time.
"But what I felt was that these young people were almost heroic. They had these special powers."
Neither Mr Matthews nor the scriptwriter, James Graham, is a mathematician. "Maths has always frightened me," Mr Graham said. "I got a B at GCSE and I had to work to get that. But I like the idea of getting an audience to experience a story through more complex, cerebral worlds."
To ensure mathematical accuracy, they recruited a real-life Olympiad graduate. "There's a history of films where people put a lot of equations on the board and it's just gobbledegook," Mr Matthews said. "Or it's nothing to do with what the teacher is talking about. But people connected to mathematics have seen our film and approved of it. I just hope it's also authentic to their experience."
He and Mr Graham are aware that their interest in pi-reciting prodigies is niche. Contemporary culture instead tends to focus on instant success, whether it's on The X Factor or YouTube.
"Previously film-makers thought that the role of drama was in finding young people who were struggling," Mr Graham said. "But I was just quite excited about treating young people as mini superheroes. Young people in their thousands across the country achieve things academically. And hopefully the film will make it seem like a worthwhile pursuit."
It would be an added bonus if teenage viewers left the cinema and immediately signed up for further maths A-level, Mr Morgan said. "I felt these were the coolest kids in the world. But they didn't realise that yet, or people around them hadn't realised that yet. If we could change the image of maths, or make maths a bit cooler, that would be a good thing."
To help matters somewhat, the maths teacher in the film, Mr Humphreys, is played by the decidedly non-geeky Rafe Spall. Mr Graham acknowledges that this might constitute a reversal of the usual staffroom stereotypes.
"Maths is traditionally seen as quite an unglamorous subject, compared with the arts or sports - or even science, where you get to burn things," he said. "I love the idea of maths teachers across the country walking into the staffroom with a bit more swagger after seeing our film."
The character is named after Mr Graham's drama teacher, Mr Humphrey, who inspired him to take part in school plays.
In fact, Mr Graham insists, the film celebrates teachers such as Mr Humphrey who emphasise that there is more to life than the quest for exam results.
"Is it about attainment, or is there a value to exploring and living in the world of academia that goes beyond grades and trophies?" he said. "The fulfilment that comes from just being curious and passionate about something has a value beyond the arbitrary assigning of grades."