Liouville Lambda Function

Return λ(n)=(−1)^Ω(n), counting prime factors with multiplicity and using λ(1)=1; trial division is limited to n≤10¹².

Description

Liouville’s lambda records the parity of the total prime-factor multiplicity.

Liouville’s lambda records the parity of the total prime-factor multiplicity. An even number of factors gives one and an odd number gives minus one.1

The tool returns value. The indexing and output conventions below determine how to read these values.

When to use Liouville Lambda Function

Use this for the following task: Return λ(n)=(−1)^Ω(n), counting prime factors with multiplicity and using λ(1)=1; trial division is limited to n≤10¹². Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use Liouville Lambda Function and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter n according to the field table, then run the tool.
  3. Read value. Use the stated units, indexing and interpretation of the numerical result.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
nPositive integer (trial-division resource limit 10^12)integer; minimum 1; maximum 1000000000000Required

Factor positive n, sum every exponent and choose the sign from the sum’s parity. One has zero total multiplicity and returns one.

λ(n)=(−1)^Ω(n)

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
valueLiouville signinteger
json
{
  "input": {
    "n": 72
  },
  "output": {
    "value": -1
  }
}

Limitations and assumptions

The input is capped at 10¹². Unlike the Möbius function, repeated prime factors do not force this value to zero.

Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.

Alternative or Complementary methods

Choose Prime Factor Count with Multiplicity when you need its operation: Return Ω(n), the total number of prime factors counting their exponents, with Ω(1)=0 and trial division limited to n≤10¹². Choose Mertens Function for the complementary operation: Return M(n)=Σ(k≤n)μ(k) exactly by sieving distinct prime factors and square factors, with M(0)=0 and n capped at 1,000,000.

Background reference: Digital Library of Mathematical Functions, §27.2.

References

  1. Digital Library of Mathematical Functions, §27.2 — National Institute of Standards and Technology

Similar or alternative tools

  • Prime Factor Count with Multiplicity

    Return Ω(n), the total number of prime factors counting their exponents, with Ω(1)=0 and trial division limited to n≤10¹².

  • Mertens Function

    Return M(n)=Σ(k≤n)μ(k) exactly by sieving distinct prime factors and square factors, with M(0)=0 and n capped at 1,000,000.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies