Create loop to find prime factors