Most people today see mathematics as being the furthest thing away from spirituality, but this has not always been the case. In the past mathematics was intimately linked with spirituality and mysticism. As far back as Plato and Pythagoras mathematics was considered a spiritual activity. Though the perceived disconnect now is wider than it was then, there are mathematicians and non-mathematicians alike who continue to see these connections.
One of the more interesting case examples of a mathematician finding a spiritual connection to their work is with Srinivasa Ramanujan (1887-1920). Ramanujan was a mathematician from India who showed from very early on a profound ability in mathematics. By age 13, he was already discovering theorems on his own and by 17 was doing original work in very advanced areas of mathematics. He eventually caught the attention of G. H. Hardy, a mathematician at Cambridge, by sending him samples of his work. Ramanujan showed a rare and unusual brilliance, and is now considered one of the great mathematicians of all time. He had profound intuitive capabilities, and could within the blink of an eye see reveal remarkable patterns and relationships. All the while, he credited these abilities to his family goddess, Namarigi, and also said that "An equation for me has no meaning, unless it represents a thought of God."
One of the most powerful direct connections between mathematics and the divine is in the matter of infinity. For many, the essence of God is synonymous with the infinite. For a long time, mathematics concerned itself primarily with the essence of the finite. The infinite was thorny and whenever mathematicians did consider it, they had a tendency to encounter strange paradoxes. For this reason, the matter of the infinite was relegated to a matter for spirituality alone. This all changed when a mathematician named Georg Cantor (1845-1918) began to muck around in the depths of the infinite.
Cantor was inspired in his work by two factors. Within mathematics, calculus was beginning to gain rigor, but this was a tricky process without directly confronting the nature of infinity. Meanwhile, Cantor was a deeply religious man and felt that God put him on Earth in order to explore the infinite. What Cantor discovered was that there are (assuming a certain way of thinking about the size of a collection) different sizes of infinity. He came to the conviction that if he could find the biggest size of infinity that it would be God. What he did find is that there are so many infinitely many sizes of infinity that there is no one size to describe how many sizes of infinity there are, nor is there one size of infinity that is larger than all others. What does this mean with respect to Cantor's quest? Did he find what he was looking for even if he couldn't recognize it?
Perhaps what Cantor's work points to is that the true nature of God transcends conceptual encapsulation. It certainly paints a beautiful portrait of the structure of infinity, but this structure itself transcends it's own language for describing the infinite. That is, one can not find what Cantor was looking for within his work, but can by stepping outside of it. By flushing out a beautiful and crystal clear mathematical vision of what can be said using logic and the conceptual mind, we gain a clearer sense of what the the infinite is in a larger context. Cantor expected that the answer to his question would fit within the mathematics he had constructed. What he found was that it didn't, and this is perhaps a far more profound conclusion.