Algosim documentation: MöbiusMu

MöbiusMu

The Möbius function.

Syntax

Description

If n is a positive integer, then

              ⎧ +1   if n is square-free and has an even number of prime factors
MöbiusMu(n) = ⎨ −1   if n is square-free and has an odd number of prime factors
              ⎩  0   if n is not square-free.

Examples

MöbiusMu(219557911565161)
−1
SequenceVector(25) @ MöbiusMu
(1, −1, −1, 0, −1, 1, −1, 0, 0, 1, −1, 0, −1, 1, 1, 0, −1, 0, −1, 0, 1, 1, −1, 0, 0)
∑(SequenceVector(100000) @ MöbiusMu)
−48
∑(SequenceVector(100000) @ MöbiusMu @ abs)
60794
n ≔ 12345; ∑(divisors(n) @ MöbiusMu)
0

See also