gives the von Mangoldt function .


  • MangoldtLambda is also know as von Mangoldt function.
  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • MangoldtLambda[n] gives zero unless n is a prime power, in which case it gives the logarithm of the prime.
  • For a positive integer n= p1k1 pmkm with pi primes, MangoldtLambda[n] returns 0 unless m is equal to 1, in which case it gives Log[p1].


open allclose all

Basic Examples  (2)

Compute the Mangoldt function at :

Plot the MangoldtLambda sequence for the first 100 numbers:

Scope  (8)

Numerical Evaluation  (3)

MangoldtLambda works over integers:

Compute for large integers:

MangoldtLambda threads over lists:

Symbolic Manipulation  (5)

TraditionalForm formatting:

Reduce expressions:

Solve equations:

Sum of MangoldtLambda over divisors:

DirichletTransform of MangoldtLambda:


Applications  (5)

Basic Applications  (3)

Highlight numbers n for which in black, and the prime bases of numbers n for which in red:

Compare MangoldtLambda sequence with logarithm function:

Plot the second Chebyshev function: [more info]

Demonstrate that it is asymptotic with :

Number Theory  (2)

Use MangoldtLambda to test for a prime power:

Plot an approximation of the number of primes and prime powers using MangoldtLambda and ZetaZero:

The more zeros used, the closer the approximation:

Properties & Relations  (7)

MangoldtLambda gives zero except for prime powers:

MangoldtLambda is neither additive or multiplicative:

MangoldtLambda satisfies the identity :

Use MoebiusMu to compute MangoldtLambda:

Use LCM to compute MangoldtLambda:

Compare with:

The sum of MangoldtLambda of the first n integers is equal to the natural log of the LCM of the first n integers:

MangoldtLambda satisfies the following identities:

Neat Examples  (3)

Plot MangoldtLambda for the sum of two squares:

Plot the arguments of the Fourier transform of MangoldtLambda:

Plot the Ulam spiral of MangoldtLambda:

Wolfram Research (2008), MangoldtLambda, Wolfram Language function,


Wolfram Research (2008), MangoldtLambda, Wolfram Language function,


Wolfram Language. 2008. "MangoldtLambda." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2008). MangoldtLambda. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_mangoldtlambda, author="Wolfram Research", title="{MangoldtLambda}", year="2008", howpublished="\url{}", note=[Accessed: 14-July-2024 ]}


@online{reference.wolfram_2024_mangoldtlambda, organization={Wolfram Research}, title={MangoldtLambda}, year={2008}, url={}, note=[Accessed: 14-July-2024 ]}