add prime factoring function to problem 47