Here are my 3 recommended movies featuring mathematician protagonists.
A Beautiful Mind

A film depicting the life of a real-life American genius mathematician. A surprising twist at the end.
Russell Crowe’s performance in the lead role is excellent.
Enigma

A 2001 film adaptation of Robert Harris’s novel “Enigma”. — Wikipedia
A story about decrypting the codes generated by the German Enigma cipher machine.
The Imitation Game

Another story about cryptanalysis dealing with the Enigma. I love the atmosphere of that era.
The Man Who Knew Infinity

A film depicting the interaction between Cambridge University mathematician G.H. Hardy and Indian mathematician Srinivasa Ramanujan. You can feel the beauty of mathematics.
The Theory of Everything

A film depicting the life of Dr. Stephen Hawking.
Particle Fever

