I have found in the preprint An Exact Formula for the Prime Counting Function the following expression for a function that is $1$ whenever n is prime, and $0$ otherwise:
$$ \mathbb{1}_{n \in \mathbb{P}}=-\mu(n) \frac{\Lambda(n)}{\log n} /(\cos \pi n)^2=-\left(-\frac{2 \sin \pi n}{\pi n}\right)^2 \sum_{j=0}^{\infty} \frac{n^{2 j}}{\zeta(2 j)} \sum_{j=1}^{\infty} n^{2 j} \log \zeta(2 j) $$
$\mu(n)$: Möbius function, $\Lambda(n)$: Von Mangoldt function and $ \zeta(2 j)=-\frac{(-1)^j(2 \pi)^{2 j} B_{2 j}}{2(2 j) !}$: zeta function at the even integers ($B_{2 j}:$ Bernoulli numbers).
Question: are there any other formula for $\mathbb{1}_{n \in \mathbb{P}}$ or for the product $\mu(n) \frac{\Lambda(n)}{\log n}$?