1

The Mertens function can be calculated in Mathematica by:

Accumulate[Table[MoebiusMu[k], {k, 1, n}]]

and is written as $$M(n)=\sum_{k=1}^n\mu(k)$$

Could someone please tell me how I would write

Table[Mean[Accumulate[Table[MoebiusMu[k], {k, 1, n}]]], {n, 1, x}]

in mathematical notation?

martin
  • 8,998

1 Answers1

1

Here is how Accumulate works: Accumulate[{a, b, c, d}] produces

{a, a + b, a + b + c, a + b + c + d}

Thus, the mth entry of the list Accumulate[Table[MoebiusMu[k], {k, 1, n}]] is $$M(m)=\sum_{k=1}^m\mu(k)$$ so that Mean[Accumulate[Table[MoebiusMu[k], {k, 1, n}]]], the average of the n entries on this list, is the just average of the first $n$ values of the Mertens function $M(k)$: $$\frac{1}{n}\left(\sum_{k=1}^nM(k)\right)\qquad$$ and then the outer Table just makes a list of these values from n=1 to n=x.

Zev Chonoles
  • 129,973