Completed Problem 47 and made some improvements to the GetAllPrimeFactors function