primes
of size 1001 with True
(assuming all numbers are prime initially).primes
as False
.unique_prime_factors
to store unique prime factors.nums
.primes
until it is no longer divisible.unique_prime_factors
.unique_prime_factors
as the result.