Alternating sum involving reciprocals of powers of primes equals $\ln(\frac{\pi}{4})$ I found the following identity in a YouTube video from 3Blue1Brown  :
$$-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\frac{1}{2\cdot9}-\frac{1}{11}+\frac{1}{13}
-\frac{1}{17}+\frac{1}{19}-\frac{1}{23}+\frac{1}{2\cdot25}-\frac{1}{3\cdot 27}+ \cdots = \ln\left( \frac{\pi}{4} \right).$$
As noted in the video, the identity is apparently related to the Leibniz formula for $\pi$, but I cannot find how it's derived, or even if it's true. I have searched for information, but found nothing about it. I didn't find this question in math.stackexchange neither.
I've tried similar method than the used in this problem, and also using directly the series of $\ln(x+1)$, but I have no idea of how to achieve the identity. It seems a hard problem.
Does someone knows were to find any information, or how to proceed?
 A: Start with $$\frac{\pi}4=1-\frac13+\frac15-\cdots=\prod_{p\equiv 1 \\\mod 4}\left(\frac1{1-\frac1p}\right)\prod_{p\equiv 3 \\\mod 4}\left(\frac1{1+\frac1p}\right),$$
where $p$ ranges over primes. Here we just use the fact that every odd number can be uniquely factorised into prime powers of odd primes, together with standard geometric series identities.  For the signs, we use that $n\equiv 1\mod 4$ if and only if we get an even number by summing the exponents of prime factors of $n$ congruent to $3 \mod 4$.
Take logs of both sides to get:
$$\ln\left(\frac{\pi}4\right)= -\left(\sum_{p\equiv 1 \\\mod 4}\ln\left({1-\frac1p}\right)+\sum_{p\equiv 3 \\\mod 4}\ln\left({1+\frac1p}\right)\right)$$
Apply the Taylor expansion of $\ln$ about $1$:
\begin{eqnarray*}\ln\left(\frac{\pi}4\right)&=& \sum_{p\equiv 1 \\\mod 4}\sum_{i=1}^\infty\frac1{ip^i}+\sum_{p\equiv 3 \\\mod 4}\sum_{i=1}^\infty\frac{(-1)^{i}}{ip^i}\\&=&
\sum_{p\text{ an odd prime}} \sum_{i=1}^\infty\frac{(-1)^{\frac{p^i-1}2}}{ip^i},\end{eqnarray*}
as desired.
A: For convenience, we define
$$
\chi(n)=
\begin{cases}
1 & n\equiv1\pmod4 \\
-1 & n\equiv4\pmod4 \\
0 & \text{otherwise}
\end{cases}
$$

For any odd number $n$, we can see that $\chi(n)=(-1)^{n-1\over2}$

so that its associated L-function $L(s,\chi)=\sum_{n\ge1}\chi(n)n^{-s}$ can be our focus. Since $\chi(n)$ is completely multiplicative, Euler product formula tells us that
$$
L(s,\chi)=\prod_p\left(1-{\chi(p)\over p^s}\right)^{-1}
$$

where $p$ stands for a prime number

Taking logarithms, we have
\begin{aligned}
\log L(1,\chi)
&=\sum_p\log\left(1-{\chi(p)\over p}\right)^{-1} \\
&=\sum_p\sum_{k\ge1}{\chi(p^k)\over kp^k}=\sum_p\sum_{k\ge1}{(-1)^{p^k-1\over2}\over kp^k}
\end{aligned}
By the famous Leibniz's series, we know that
$$
L(1,\chi)=\sum_{n\ge1}{\chi(n)\over n}=\sum_{m\ge0}{(-1)^m\over2m+1}=\frac\pi4
$$
As a consequence, we obtain the following series:
$$
\sum_p\sum_{k\ge1}{(-1)^{p^k-1\over2}\over kp^k}=\log\frac\pi4
$$
