Mathematics and literature
I am surprised that no one has mentioned Jorge Luis Borges well regarded novels.
In particular The Library of Babel and The Book of Sand, both of which deal with infinity and set theory amongst other themes such as the related philosophical themes of Kant and Hume.
Both of these books have been cited as influential by contemporary novelists such as Umberto Eco and philosophers such as Quine and Dennett.
The Oulipo is a group of novelists, poets and mathematicians, trying to make their writing more original by imposing combinatorial constraints on the text, or playing various combinatorial games with it.
One of the best known examples is Raymond Queneau's Cent mille milliards de poèmes (100,000,000,000,000 poems, this large set of poems can be described succinctly as a cartesian product of smaller sets).
Another more contrived example uses the Fibonacci sequence and Zeckendorf's theorem to constrain the semantic dependences (and the rhymes, as well) of the verses of a poem (Anthologie de l'Oulipo, M. Benabou and P. Fournel editors, Gallimard, 2009, page 158).
Change ringing was somewhat similar, but the combinatorial constraints were applied to music.
Hiroshi Yuki's Math Girls (which is available in English translation from the original Japanese) is mostly mathematics, with a thin story about the narrator's relationship with two girls with whom he studies mathematics.
Much better from a literary standpoint is Yoko Ogawa's The Housekeeper and the Professor (also available in translation from the original Japanese). The housekeeper cares for a former mathematician who has lost his ability to form new memories in a car accident. However, he does remember his mathematics. He also likes children. When the professor meets the housekeeper's son, he establishes a relationship with the boy (whose name he can not remember) by teaching him mathematics.