Confirming your payment

Skip to content

The World of Algorithms · Question 14 of 15

(Challenge) Write an algorithm primedivisors(n) to compute the list of divisors of n that are prime numbers.

Question 143 marksMedium

(Challenge) Write an algorithm primedivisors(n)\text{primedivisors}(n) to compute the list of divisors of nn that are prime numbers.

(Hint: Compute divisors(n)\text{divisors}(n) and then filter out the primes in this list.)