Mathematics and the Divine: A Historical Study