This was fun! First, you calculate all the primes up to the square root
of the number you are looking for. Then, if your number is divisible by
any of those numbers, the largest one is the largest prime. If not, that
number is prime, and therefore the largest prime factor!