Dev Patel stars in the remarkable true story of self-taught, early 20th-century Indian mathematician Srinivasa Ramanujan.

This biopic focuses on Ramanujan’s friendship with Cambridge don GH Hardy (Jeremy Irons), who invited him to England in 1913 and, in the teeth of prejudice, became his ardent champion. ‘Just as Mozart would hear an entire symphony in his head,’ he tells his protégé, ‘you dance with numbers to infinity.’ Initially scorned, Ramanujan’s groundbreaking work in number theory revolutionised mathematics, although his ideas were only be fully appreciated years after his tragically early death at the age of 32 in 1920.

Writer-director Matthew Brown’s film is a little by the numbers, with much of the drama hanging on the contrast between the intuitive Ramanujan and the rigorously methodical Hardy. One is an untutored shipping clerk from Madras separated by 6,000 miles from his young bride (Devika Bhise), the other a crusty bachelor married to mathematics; one believes an equation has no meaning unless it expresses ‘a thought of god’, the other is an atheist who doesn’t believe in anything he can’t prove.

Yet even if the movie is fairly formulaic, Patel’s sympathetic performance keeps us engaged and he gets strong support from the likes of Toby Jones, Jeremy Northam, Stephen Fry and, above all,  Irons, who delivers a masterclass in cranky eccentricity and buttoned-up reserve.