The mind is nothing but the sum total of human experience considered from the standpoint of dependence upon the experiencing individual.
I would not dare to say that there is a direct relation between mathematics and madness, but there is no doubt that great mathematicians suffer from maniacal characteristics.