The Liouville Function #
This file defines the Liouville function λ(n).
Main Definitions #
ArithmeticFunction.liouvilleis the Liouville functionλ(n)defined to be1ifnhas an even number of prime factors (counting multiplicity) and-1otherwise.
OEIS A008836 (the sequence skips n = 0)
Equations
- ArithmeticFunction.liouville = { toFun := fun (n : ℕ) => if n = 0 then 0 else (-1) ^ ArithmeticFunction.cardFactors n, map_zero' := ArithmeticFunction.liouville._proof_1 }