Mathematics, Philosophy and writing. Do you know of any famous mathematicians who were also philosophers? I have heard of Descartes, Plato and Leibniz. Are there other good examples, especially more modern examples? 
Also welcome are works of literature which use mathematics in descriptions and use mathematical properties in their works (maybe like Borges in the Book of Sand, or Flatland by Edwin Abbott). 
 A: Kurt Gödel considered himself a philosopher who did mathematics, rather than as a mathematician who did philosophy.  His philosophy is non-standard, and has not been taken seriously by some, but he has a Stanford Encyclopedia of Philosophy article, which makes it "official".
A: As for literature...
Clifton Fadiman's Fantasia Mathematica is a compendium of stories and peoms related to mathematics.
Jacques Roubaud, one of the members of the French literary group "Oulipo", founded by Raymond Queneau and sometime mathematician Francois Le Lionnais.  His The Princess Hoppy has a group theory puzzle.
Georges Perec, another member of Oulipo, has a linear algebra proof in his novel, La Vie: Mode d'Emploi (Life: A User's Manual), correctly typeset in French and horribly mangled in the English translation.
Victor Snaith, a mathematician, has written a novel, The Yukiad, but I'm not sure how much math is in it.
Mark Twain, Roughing It, "I acknowledge freely that I have had hard feelings against Mr. Ballou for abusing me and calling me a logarithm, which is a thing I do not know what, but no doubt a thing considered disgraceful and unbecoming in America."
Yoko Ogawa, The Housekeeper and the Professor, a mathematics professor had a car accident which left him unable to form new permanent memories.  With the help of a new housekeeper, he is able to create through post-it notes an axiomatic system that allows him to recreate his life each morning.  It's a charming novel.
P.G. Wodehouse, Uncle Fred in the Springtime: "Nature, stretching Horace Davenport out, had forgotten to stretch him sideways, and one could have pictured Euclid, had they met, nudging a friend and saying: 'Don’t look now, but this chap coming along illustrates exactly what I was telling you about a straight line having length without breadth.'"  A similar line appears in Uneasy Money (Wodehouse was never one to waste a good line.)
Tom Stoppard, Arcadia, a play. Fermat's last theorem; iteration & chaos.
David Auburn, Proof, a play.  Primes.
Jay Wright, Polynomials and Pollen, poems.
Andrew Marvell, "The Definition of Love," poem.  Euclidean geometry.
Strange Attractors: Poems of Love and Mathematics, a collection.
All involve mathematics to varying degrees.
Also:
Gert Jonke Geometrischer Heimatroman, (Geometric Regional Novel)
Thomas Pynchon, Gravity's Rainbow.  Contains a PDE, a Poisson distribution, and other aspects of rocket science.
A: Bertrand Russell and Alfred North Whitehead.
A: Does not exactly fit the question, but:
Edmund Husserl, made his doctorate in math, worked as assistant of Weierstrass. Afterwards he devoted himself to philosophy, and became one of the most ininfluential philosophers of the XX century (and not in the "analytic" branch).
And perhaps even less pertinent, but interesting nevertheless:
André Weil, was certainly not a philosopher; but, besides having more humanistic formation and interests than most mathematicians, he had a sister who was a philosopher (in the wide sense): the great Simone Weil. She herself wrote some things about science and math, though that's not the best from her IMO.
A: I mentioned in the comments:


*

*Charles Sanders Peirce

*W.V.O. Quine

*Bertrand Russell

*A.N. Whitehead
But also:


*

*Bernard Bolzano

*George Boolos

*Alonzo Church

*René Descartes

*Solomon Feferman

*Gottlob Frege

*Kurt Gödel

*David Hilbert

*Pierre-Simon Laplace

*Jan Łukasiewicz

*Blaise Pascal

*Henri Poincaré

*Hilary Putnam

*Frank P. Ramsey

*Raymond Smullyan

*Alfred Tarski
And this list omits many people who were philosophers who considered mathematics (such as Wittgenstein or Hintikka) or mathematicians who thought philosophically about mathematics (such as Brouwer) or logicians who published mathematical logic articles in philosophy journals, or mathematicians who found themselves doing early research on AI and therefore became philosophers of mind (such as Turing or Yehoshua Bar-Hillel), or a large number of scholars (such as Pythagoras, Galileo, or Newton) who lived before the modern separation of mathematics and philosophy, as well as many mathematician-philosophers who are not truly famous.
