Prime Factorisation Formula for the Greatest Common Divisor