i've been trying to solve this problem for days but i still couldnt get the correct output. the problem is like this, for example if i use the number 50, it has a list [2, 5]
as its prime factors
and the corresponding multiplicities
of those factors
are as follows [1, 2]
prime_factors = [2, 5]
multiplicities = [1, 2]
so the divisors
should have an output
of [1, 2, 5, 10, 25, 50]
but that's just the problem, how do i create a function
that gets all the divisors
of a certain input
, using its prime factors
and their corresponding multiplicities
?
Well, the question is "how do I write a function", so maybe those advices may help you:
If you are stuck on any of these steps, people here will gladly help, we just have to have some starting point. I would recommend writing out each element in the output and where it comes from. Good luck!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.