THE moving story of a maths sensation and former York College student has inspired a new British film.

X plus Y starring Asa Butterfield, Sally Hawkins and Rafe Spall and directed by Morgan Matthews had its world premiere at the Toronto Film Festival and is based on the BBC documentary Beautiful Young Minds (BYM) screened in 2007, which featured the story of then teenager Daniel Lightwing.

As The Press reported at the time, Daniel, who is originally from Warthill, near York, starred in the documentary which told the story of some of the brightest mathematical brains of a generation. Each year, exceptionally gifted teenagers from more than 90 countries compete for medals at the International Mathematical Olympiad and the documentary followed a group of brilliant teenagers as they battle it out to become the chosen six selected to represent the UK.

Daniel, who was 17 at the time of filming BYM, was diagnosed with Aspergers' Syndrome, a form of autism that affects the way a person communicates and relates to others, and the film is largely based on his life, showing a young man with Asperger’s who struggled with social interactions and relationships, but still managed to attain success with a silver medal in the IMO, representing the UK.

Daniel spent a year training with the UK maths squad, teaching English in China and travelling. He was then selected for the UK team at the main International Mathematics Olympiad and went on to study maths and oriental studies at Cambridge.

His love of China, its language and his marriage to Yan Zhu, a Chinese girl, featured on BYM, has many similarities with X plus Y.

The film follows a character called Nathan, played by Asa Butterfield - who starred in The Boy in the Striped Pyjamas and Ender's Game - who struggles to connect with people and finds the comfort and security he needs in numbers and mathematics.

It has its UK premiere at Leicester Square Odeon on October 13 and Daniel and his family plan to be there.

Daniel is now 26 and living in London, has worked as a programmer for Google and recently joined the company Greenday, who are building what will be the largest building in Europe, as IT, translating and marketing manager.

His proud dad, David, an Elvington GP, who still lives in Wharthill with his wife, Carolyn, said: "Daniel met Asa, and they spent the afternoon together. Asa does a terrific job portraying the pathological shyness of Daniel's Aspergers and Daniel was happy with the scripts and that was important. My wife and Daniel were sitting in our lounge reading it together and chuckling away. We are all very excited about the premiere."

The film's UK release date is March 13 next year.