Implemented solution to problem #3: Largest prime factor