Actually I've seen a horror movie kinda about math, called "Cube". There are some guys inside of a giant cube with a cube rooms filled with deadly traps, and the only why to get to the exit safely is doing math.