If you consider Bertrand Russell to be a mathematician, he wrote two volumes of short stories near the end of his life but they were met with ''baffled silence'' even by his most ardent fans (in the words of his biographer Ray Monk).
Eric Temple Bell (known for Bell polynomials) wrote poetry and science fiction novels under the pseudonym John Taine. His science fiction novels are known for their interesting ideas but as a writer he is considered to be extremely lacking in style, tone, sensitivity and characterization (plus anything else one might expect from a good fiction writer).
Ian Stewart has also written fantasy fiction books with Terry Pratchett.