Mertens
The Mertens function.
Syntax
-
Mertens(n)
-
n
is a positive integer
-
Description
If n
is a positive integer, then Mertens(n)
is defined as the number of square-free positive integers up to n
with an even number of prime factors minus the number of square-free positive integers up to n
with an odd number of prime factors.
Hence,
Mertens(n) = ∑(MöbiusMu(k), k, 1, n).
Examples
Mertens(100000)
−48
SequenceVector(20) @ Mertens
(1, 0, −1, −1, −2, −1, −2, −2, −2, −1, −2, −2, −3, −2, −1, −1, −2, −2, −3, −3)
count(SequenceVector(1000) @ Mertens, IsPositive)
254
collapse(SequenceVector(1000) @ Mertens @ sgn)
(1, 1) (0, 1) (−1, 36) (0, 2) (−1, 17) (0, 1) (−1, 6) (0, 1) (−1, 27) (0, 1) (1, 7) ⋮