Counting the number of positive integers ($n(x)$) below a certain number x, is obviously simple and trivial: it is just $x$, however only when $x$ is an integer.
In the logarithmic prime counting function $\psi(x) = x - \log(2\pi) - \frac12 \log(1- \frac{1}{x^2}) - \sum_{\rho} \dfrac{x^{\rho}}{\rho}$, a constant (first term), the infinite sum of trivial zeros (middle term) and the infinite sum of non-trivial zeros (last term) of $\zeta(s)$, nicely account for the gaps between $x$ and $\psi(x)$. This annihilates the approximation errors of $\psi(x)$ at the integers, but also between them and induces the required prime step-function.
I wondered if a similar 'bottom up' formula exists, i.e. involving the infinite sums of (complex) zeros (call them $\mu$) of a function. Such formula would then look like: $n(x) = x - c - \sum_{\mu} \dfrac{x^{\mu}}{\mu}$. At the integers it obviously needs to be zero, but between the integers it needs to sum up an infinite amount of sine waves that then culminates into the saw tooth pattern in the graph below.
Does such a function exist? And if so, could it be extended towards counting e.g. only even or only odd numbers?
EDIT:
The formula for the sawtooth wave in the graph above is easy to derive and is:
$$\displaystyle saw(x):=\frac12 - \frac{1}{\pi} \sum_{n=1}^{\infty} \frac{\sin(2nx\pi)}{n}= \frac12 +\frac{i}{2\pi}\ln(e^{-2\pi i (x-\frac12)})$$
However, this does not yet allow me to express $n(x)$ into an infinite sum involving (complex) zeros.