primeFactors
Finds the prime factors of a given number using the trial division algorithm.
- Use a
whileloop to iterate over all possible prime factors, starting with2. - If the current factor,
f, exactly dividesn, addfto the factors array and dividenbyf. Otherwise, incrementfby one.