What am I doing wrong with Möbius inversion?

111 Views Asked by At

Let $p\left(n\right)$ be $1$ if $n$ is a prime, and $0$ otherwise. Recall the prime divisor function.

$$w\left(n\right)=\sum_{d\mid n}p\left(d\right)$$

By the Möbius inversion formula, we have

$$p\left(n\right)=\sum_{d\mid n}w\left(d\right)\mu \left(\frac{n}{d}\right)$$

Let's write the prime counting function with this.

$$\begin{align} \pi \left(n\right) &= \sum_{t\leq n}p\left(t\right) = \sum_{t\leq n}\sum_{d\mid t}w\left(d\right)\mu \left(\frac{t}{d}\right)\\ &= \sum_{t\leq n}\sum_{ab=t}w\left(a\right)\mu \left(b\right) = \sum_{ab\leq n}w\left(a\right)\mu \left(b\right)\\ &= \sum_{a\leq n}w\left(a\right)\sum_{b\leq \frac{n}{a}}\mu \left(b\right) = \sum_{a\leq n}w\left(a\right)M\left(\frac{n}{a}\right) \end{align}$$

Where $M$ is the Mertens function.

The twin prime counting function is

$$\begin{align} \pi _{2}\left(n\right) &=\sum_{t\leq n}p\left(t\right)p\left(t+2\right) = \sum_{t\leq n}\left(\sum_{d\mid t}w\left(d\right)\mu \left(\frac{t}{d}\right)\right)\left(\sum_{d\mid t+2}w\left(d\right)\mu \left(\frac{t+2}{d}\right)\right)\\ &= \sum_{t\leq n}\sum_{\left(d_{1}\mid t,d_{2}\mid \left(t+2\right)\right)}w\left(d_{1}\right)w\left(d_{2}\right)\mu \left(\frac{t}{d_{1}}\right)\left(\frac{t}{d_{2}}\right) = \sum_{t\leq n}\sum_{\left(ab=t,cd=t+2\right)}w\left(a\right)w\left(c\right)\mu \left(b\right)\mu \left(d\right)\\ &= \sum_{\left(ab\leq n,cd\leq n+2\right)}w\left(a\right)w\left(c\right)\mu \left(b\right)\mu \left(d\right) \end{align}$$

If we use same transformations, we have

$$\pi _{2}\left(n\right)=\sum_{\left(a\leq n,cd\leq n+2\right)}w\left(a\right)w\left(c\right)\mu \left(d\right)\sum_{b\leq \frac{n}{a}}\mu \left(b\right)=\sum_{\left(a\leq n,cd\leq n+2\right)}w\left(a\right)w\left(c\right)\mu \left(d\right)M\left(\frac{n}{a}\right)$$

Eventually this comes up.

$$\pi _{2}\left(n\right)=\sum_{\left(a\leq n,c\leq n+2\right)}w\left(a\right)w\left(c\right)M \left(\frac{n+2}{c}\right)M\left(\frac{n}{a}\right)=\sum_{a\leq n}w\left(a\right)M\left(n/a\right)\sum_{a\leq n+2}w\left(a\right)M\left(\frac{n+2}{a}\right)=\pi \left(n\right)\pi \left(n+2\right)$$

Which is nonsense. What am I doing wrong?

2

There are 2 best solutions below

2
On BEST ANSWER

$$\begin{align} \pi _{2}(n) &=\sum_{t\leq n}p(t)p(t+2)\\ &=\sum_{t\leq n}(\sum_{d\mid t}w(d)\mu (\frac{t}{d}))(\sum_{d\mid t+2}w(d)\mu (\frac{t+2}{d}))\\ &=\sum_{t\leq n}\sum_{(d_{1}\mid t,d_{2}\mid (t+2))}w(d_{1})w(d_{2})\mu (\frac{t}{d_{1}})\underbrace{(\frac{t}{d_{2}})}_{\mu\left(\frac{t+2}{d_2}\right)}\tag{Typo}\\ &=\sum_{t\leq n}\sum_{(ab=t,cd=t+2)}w(a)w(c)\mu (b)\mu (d)\\ &=\sum_{(ab\leq n,cd\leq n+2)}w(a)w(c)\mu (b)\mu (d)\tag{Error} \end{align}$$

Not going into the typo, which anyway is corrected in the next line, the last line is the big mistake. You dropped the condition that $cd - ab = 2$, and that produces a lot of additional terms that shouldn't be there.

0
On

I realize there is already a good answer, but for future readers:

Your first line defines the prime divisor function as the count of divisors of n that are prime.

But your Möbius inversion translates to ~ p(n) = Sum for all divisors of n ...

I tested it in sage and it didn't work: p(29) = p(30). After tweaking it, my best effort was this:

for n in range(1, 31):
        print sum([sigma(d, 0)*moebius(n/d) for d in prime_range(2, n) if mod(n, d) == 0]) + sigma(n, 0),
# don't include d=1, d composite; don't exclude d=n composite.

which translates to:

$$p(n)=\sum_{p\mid n}^{p \in \mathbb{P} \cup \{n\}} w(p)\mu (\frac{n}{p}) \equiv 2 $$ But that can be simplified to: $\; p(n) = w(n) \equiv 2$