素数判定機

Check if a number is prime and find its factors.