# Prime Counting Function as Sum of Heaviside Step Functions

Inspired by Logarithmic derivative on the critical strip, I would like to ask, if it is possible to write $\pi(n)$ as a sum of step functions like the following: $$\pi(n)=\sum_{k=1}^{N} H(n-p_k), \tag{\ast}$$ with $p_k$ the $k$th prime, $p_N\le n$ and $H(x)$ being the Heaviside Step Functions and further use $$H(x) = \int_{-\infty}^x { \delta(t)} \, \mathrm{d}t,$$ such that ($\ast$) gets $$\pi(n)=\sum_{k=1}^{N} \int_{-\infty}^{(n-p_k)} { \delta(t)} \, \mathrm{d}t ?$$

Some comments: first of all, you can even write $$\pi(n) = \sum\limits_{k=1}^\infty H(n-p_k)$$ since $H(n-p_k) = 0$ for all $p_k>n$ so these terms do not change the sum. Following the same reasoning, you can write $$\pi(n) = \sum\limits_{k=1}^\infty\int\limits_{-\infty}^{n-p_k}\delta(t)\mathrm dt$$ if only it help to deal with $\pi$. Here you should be careful with explicitly mentining that $$\int\limits_{-\infty}^0\delta(t)\mathrm dt :=1.$$ Also, in your case $N = \pi(n)$ as I guess, so of course all formulas are true: $$\pi(n) = \sum\limits_{k=1}^N H(n-p_k) = \sum\limits_{k=1}^{\pi(n)} H(n-p_k)$$ and $$\pi(n) = \sum\limits_{k=1}^N\int\limits_{-\infty}^{n-p_k}\delta(t)\mathrm dt =\sum\limits_{k=1}^{\pi(n)}\int\limits_{-\infty}^{n-p_k}\delta(t)\mathrm dt.$$ Finally, these formulas work for any increasing sequence $p_k$, not necessary being prime numbers.
• Thanks for your answer. May I call $\int\limits_{-\infty}^{n-p_k}\delta(t)\mathrm dt$ the characteristic function of primes, since summing over it gives back $\pi(n)$? Somehow this doesn't feel correct... – draks ... Jun 4 '12 at 13:07
• @draks: The integral expression you have depends on both $n$ and $k$. They are the characteristic functions of the sets $[p,\infty)$ for primes $p$. – anon Jun 4 '12 at 13:21
• Is that dependance on $n$ and $k$ a problem? And so the sum over the integrals is the characteristic function of ALL primes? – draks ... Jun 4 '12 at 13:43
• Maybe it becomes clearer when I write it like $\sum \int_{-\infty}^n \delta(t-p_k)dt$. Taking this Definition $\chi_{P} (x):=\begin{cases} 0,&x\in P \\ +\infty, & x \not \in P \end{cases}\,\,$, my sum looks like the inverse (forgot that before) of a characteristic function of primes, doesn't it? – draks ... Jun 4 '12 at 20:57