Möbius function: Difference between revisions

(→‎{{header|Python}}: Warning: Bugs!)
Line 1,816:
The idea is based on efficient program to print all prime factors of a given number. The interesting thing is, we do not need inner while loop here because if a number divides more than once, we can immediately return 0.
 
# BUGS ! mu(01): computes -1, correct 1
# BUGS ! mu(12): computes 1, correct -1
# BUGS ! mu(105): computes 1, correct -1
# BUGS ! ...
2

edits