# 莫比乌斯函数（Möbius function，moebius_mu）

莫比乌斯函数：若某个平方数整除 n 则为 0，否则根据其质因数个数的奇偶性为 1 或 -1。

## 怎么写

### moebius_mu(n)

**n**

一个整数。接受一个整数。

## 示例

- $\displaystyle \operatorname{moebius\_mu}(30) = -1$

  `moebius_mu(30)`

  在求解器中，`moebius_mu(30)` 的结果是 `-1`。

  [在求解器中打开](https://zh.hilberon.com/?q=moebius_mu%2830%29)

## 相关函数

- [multinomial](https://zh.hilberon.com/library/multinomial)

  多项式系数：把 n 个物品分成给定大小的各组的方法数。
- [modular_inverse](https://zh.hilberon.com/library/modular_inverse)

  一个整数在模另一个数下的逆元。
- [multiplicative_order](https://zh.hilberon.com/library/multiplicative_order)

  一个数模另一个数等于 1 的最小幂次。
- [lucas_l](https://zh.hilberon.com/library/lucas_l)

  第 n 个卢卡斯数。
- [next_prime](https://zh.hilberon.com/library/next_prime)

  大于某个数的最小质数。
- [jacobi_symbol](https://zh.hilberon.com/library/jacobi_symbol)

  Jacobi 符号 (a/n)，其中 n 为奇正数。

---
Source: https://zh.hilberon.com/library/moebius_mu
