Skip to content

LiouvilleLambda ​

The Liouville function λ(n)=(−1)Ω(n)\lambda(n)=(-1)^{\Omega(n)}.

✓ checked against that system · ! checked, with disagreements (hover a chip)FungrimLiouvilleLambdaFungrim entrye4e707Wolfram LanguageLiouvilleLambda✓
LiouvilleLambda(n)(−1)Ω(n)(-1)^{\Omega(n)}
Typed signatures
TypePackageApplies
(integer) -> integernumber-theoryalways

Domain: Number theory

Details
  • Completely multiplicative: λ(mn)=λ(m)λ(n)\lambda(mn)=\lambda(m)\lambda(n) for every m,nm,n, not just coprime ones — unlike MoebiusMu.
  • ∑d∣nλ(d)\sum_{d\mid n}\lambda(d) is 1 when nn is a perfect square and 0 otherwise.

Examples

Basic #

Ω(12)=3\Omega(12)=3

live ↗
InLiouvilleLambda(12)\mathrm{LiouvilleLambda}(12)Out−1-1
live ↗
InLiouvilleLambda(10)\mathrm{LiouvilleLambda}(10)Out11
live ↗
InLiouvilleLambda(1)\mathrm{LiouvilleLambda}(1)Out11

8=238=2^3 has three prime factors with multiplicity, so −1-1

live ↗
InLiouvilleLambda(8)\mathrm{LiouvilleLambda}(8)Out−1-1

9=329=3^2 has an even count of prime factors, so +1+1

live ↗
InLiouvilleLambda(9)\mathrm{LiouvilleLambda}(9)Out11
Scope #

Listable

live ↗
InLiouvilleLambda(1..10)\mathrm{LiouvilleLambda}(1..10)Out[1,−1,−1,1,−1,1,−1,−1,1,1]\bigl\lbrack1, -1, -1, 1, -1, 1, -1, -1, 1, 1\bigr\rbrack

Big integer input is factored exactly

live ↗
InLiouvilleLambda(1+1030)\mathrm{LiouvilleLambda}(1+10^{30})Out−1-1

Threads over a list, giving the signs of (−1)Ω(n)(-1)^{\Omega(n)}

live ↗
InLiouvilleLambda([1,2,3,4,5,6])\mathrm{LiouvilleLambda}(\bigl\lbrack1, 2, 3, 4, 5, 6\bigr\rbrack)Out[1,−1,−1,1,−1,1]\bigl\lbrack1, -1, -1, 1, -1, 1\bigr\rbrack
Properties #

λ(n)=(−1)Ω(n)\lambda(n)=(-1)^{\Omega(n)}. See PrimeOmega

live ↗
InLiouvilleLambda(360)=(−1)PrimeOmega(360)\mathrm{LiouvilleLambda}(360)=(-1)^{\mathrm{PrimeOmega}(360)}OutTrue\mathrm{True}

Completely multiplicative, even for non-coprime factors (162=6⋅27162=6\cdot27)

live ↗
InLiouvilleLambda(162)=LiouvilleLambda(6)LiouvilleLambda(27)\mathrm{LiouvilleLambda}(162)=\mathrm{LiouvilleLambda}(6)\mathrm{LiouvilleLambda}(27)OutTrue\mathrm{True}

60=22⋅3⋅560=2^2\cdot3\cdot5 has four prime factors counted with multiplicity

live ↗
InLiouvilleLambda(60)\mathrm{LiouvilleLambda}(60)Out11

Three distinct primes give −1-1

live ↗
InLiouvilleLambda(30)\mathrm{LiouvilleLambda}(30)Out−1-1

120=23⋅3⋅5120=2^3\cdot3\cdot5 has five prime factors with multiplicity

live ↗
InLiouvilleLambda(120)\mathrm{LiouvilleLambda}(120)Out−1-1

A prime square always gives +1+1

live ↗
InLiouvilleLambda(25)\mathrm{LiouvilleLambda}(25)Out11

Every prime has value −1-1

live ↗
InLiouvilleLambda(2)\mathrm{LiouvilleLambda}(2)Out−1-1

Known value · Wolfram MathematicalFunctionData, LiouvilleLambda

A second prime, same sign

live ↗
InLiouvilleLambda(3)\mathrm{LiouvilleLambda}(3)Out−1-1

Known value · Wolfram MathematicalFunctionData, LiouvilleLambda

4=2⋅24=2\cdot2, two factors with multiplicity

live ↗
InLiouvilleLambda(4)\mathrm{LiouvilleLambda}(4)Out11

Known value · Wolfram MathematicalFunctionData, LiouvilleLambda

Two distinct primes multiply the signs to +1+1

live ↗
InLiouvilleLambda(6)\mathrm{LiouvilleLambda}(6)Out11

Known value · Wolfram MathematicalFunctionData, LiouvilleLambda

Over the divisors of a perfect square the sum is 11

live ↗
InDivisorSum(64,()↦LiouvilleLambda(_1⁡))\mathrm{DivisorSum}(64, ()↦\mathrm{LiouvilleLambda}(\operatorname{\_1}))Out11

For a non-square the divisor sum is 00

live ↗
InDivisorSum(7,()↦LiouvilleLambda(_1⁡))\mathrm{DivisorSum}(7, ()↦\mathrm{LiouvilleLambda}(\operatorname{\_1}))Out00
About
Examples20
Checked againstWolfram Language 20 agree
CrosswalkFungrimFungrim entryWolfram Language

See also: MoebiusMu, PrimeOmega