The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
final long value = 600851475143L; long temp = value; long prime = 2; while (temp>1L) { if (temp%prime==0) { System.out.println(prime); temp = temp/prime; } else { prime++; } }
Lösung: 6857