Möbius function (problemas formula)

For any positive integer n, the Möbius function mu left parenthesis n right parenthesis is defined as

$$\mu\left(n\right)=\left\{\begin{array}{l}1,\;\text{if }\;n\;\text{is a square-free positive integer with an even number of prime factors}\\-1,\;\text{if }\;n\;\text{is a square-free positive integer with an odd number of prime factors}\\0,\;\text{if }\;n\;\text{has a squared prime factor}\end{array}\right.$$

mu_moebius(Integer)

Given an integer n, returns mu left parenthesis n right parenthesis as defined above.