A mystery novel which takes place in a 14th Century monastery by the brilliant Italian author, Umberto Eco. This book only has a small amount of math in it, but I frequently receive recommendations to include it on the list of mathematical fiction. The following description from Mike Melvin convinced me that it was worth adding:

Contributed by
Michael Melvin

THE NAME OF THE ROSE has interesting passages from William of Baskerville, who muses that mathematics was the key to understanding how God made the world, if not the labyrinth he and Adso are navigating. If you'll remember, he and Adso use simple addition to figure out how many rooms are in the library, without even visting them! OK, not exactly elegant theorems, but that's how we humans passed from being terrified, superstitious beings to reasoning people. William represented science AND faith in the Middle Ages. If I was a math teacher, I'd recommend it to math-shy students who may need an appreciation of what math has done for civilization.

Mathematics appears in more subtle fashion as the maze-solving scheme used by Brother William in Umberto Eco’s The Name of the Rose. The scheme is a "depth-first search algorithm" in computer-science jargon, with an underlying mathematical justification.