Function number_of_divisors(n) returns wrong results
https://github.com/TheAlgorithms/Python/blob/master/maths/basic_maths.py
Function number_of_divisors(n) returns wrong results, e.g., number_of_divisors(6) produces 2. Correct answer should be 4.
After factorization, if n is not 1, this means it's a prime which has two divisors, thus the result should be multiplied by 2.
Solution: add the following code before function returns (line 60),
if n > 1: div *= 2
Dear @yuanyanhui, Could you assign this issue to me? Thanks.
@ramkishanteli2 Seems only maintainers can assign issues.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issues seems to have been resolved in commit 42a80cdaf689b03b326164862318039bd43bbff1 PR #6017.
Has this issue been solved? If not, I would like to take this up.
@debjit-bw as I said in the previous comment, I think this has been solved in the pointed commit (you can take a look by yourself). Sadly I don't think this issue gets much attention, and I doubt it will ever be closed...
Oh sorry @Bjiornulf, I completely missed your earlier comment. Yeah this issue seems fixed. Thanks!
Hello, Can you assign this issue to me?