Cryptonomicon is a book by Neal Stephenson. One of the main characters in the WWII timeline is Lawrence Waterhouse, a mathematician and cryptologist. Waterhouse gets to interact with Alan Turing.
Neal Stephenson later wrote a series (the Baroque cycle, starting with Quicksilver) which featured ancestors of the characters in Cryptonomicon. The Waterhouse in Quicksilver works with Isaac Newton and encounters Leibniz, but is not a mathematician.
(I don't think either of these works is as good as Stephenson's Snow Crash, but that doesn't feature mathematicians.)