Young Italo helmer Saverio Costanzo referenced a wide range of movies to make his ambitious genre-blender, “The Solitude of Prime Numbers,” about a despondent male mathematician and a scarred female skier who bond over similarly troubled childhoods.

Costanzo not only cited Michelangelo Antonioni’s “L’Avventura” and Ingmar Bergman among his influences, but also John Carpenter, Dario Argento “and other 1980s horror movies I grew up with.”

And he is pleased that fest topper Marco Mueller described the Venice competition player “as a “supernatural thriller.”

Based on the widely translated Italian bestseller by Paolo Giordano, “Numbers” was produced by Mario Gianani’s Wildside and Medusa, with Germany’s Bavaria Film, which is also selling, as a co-production partner. Pic, -which stars Alba Rohrwacher and Isabella Rossellini, will segue to Toronto.

The adaptation of such a well-known tome was a big challenge for Costanzo, who worked with Giordano on the script.

“I think I was faithful to the original,” he said. “But at the same time I wanted to surprise the spectator, who presumably had read Paolo’s book; so I wanted audiences not be wondering what was happening, but why it was happening.”

Another challenge was for the actors. The protags both inflict bodily harm on themselves during the 24 years depicted in the film.

“Saverio had the intuition of having us work starting from our bodies, and that was fundamental for us to get to the point where we could honestly convey the characters’ pain,” said Rohrwacher.

Medusa will release “Numbers” on 380 prints in Italy today, while Gaul’s Le Pact will release it in France.