Solution for problem 5.
Refactor to use the prime factorisation method of solving least common multiple problems. This is a highly optimised in comparison to my previous brute force implementation.