Mathematics becomes more than the stuff of SAT nightmares in Fermat's Room, a tense thriller screened last night at the Imagine Science Film Festival in New York City. When four skilled mathematicians solve a puzzle and are invited to a secluded conference, they're promised the world's greatest enigma. Instead, they find themselves in a slowly shrinking space, with less than an hour to figure out how they're connected and who wants them dead — or the giant hydraulic presses will finish the job. Only by correctly solving the mathematical mind-twisters delivered via PDA can they buy a little time. Fermat's Room, from Spanish directors Luis Piedrahita and Rodrigo Sopeña, manages to turn math into a deadly, mysterious game. Everyone assembled in the room has secrets, of course, and motivations they are hiding. But as the walls literally close in on the characters, increasing desperation forces them into confrontation. As they try to unravel who is behind the crime, they must solve various "enigmas" to keep back the walls (though some of the problems are a bit too familiar, like the "Light Switch Puzzle"). Math is presented throughout as almost a magical skill, wielded by experts who treat its pursuit as something worth stealing and dying for. It has already brought some of them fame and fortune. Like superheroes, they've all been given special identities to wear: Pascal, Galois, Oliva, and Hilbert. At the same time that it is concerned with theorems and numerical traps, the movie looks at the ways technology can be programmed to work independently against us. Only raw mortal reasoning can stave it off. Fermat's Room also explores some very human failings of conscience, and yields a high level of drama between its characters. When there is little room left, paranoia and accusation rage in a way reminiscent of The Twilight Zone's best tension. It is rare that cinematic heroes get to be pure mathematicians, but here that knowledge is essential for survival, front and center. With the terror of encroaching walls — an effective scene-setter in everything from Star Wars to that other people-in-a-box-with-math thriller, 1997's Cube — the plot is always pushed forward and does its best to keep you guessing, even if the revelations aren't always earth-shaking. This is a fine, fluid production, well-cast and visually appealing. It's definitely the best film you'll see about sexy angst-laden imperiled math geniuses this year. You can watch the trailer below.

The Imagine Science Film Festival is running a rich and varied program of events until October 25th around New York City. All screenings are gloriously free, and all of the movies find an inspirational spark in science.