TITLE: Infinite sum involving number of solutions to $k=i^2+j^2$
QUESTION [11 upvotes]: I want to calculate the following sum:
$$
S=\sum_{k=1}^\infty (-1)^{k-1}\frac{r_2(k)}{k}
$$
Where $r_2(k)$ is the number of ways to write $k$ in the form $i^2+j^2$ where $i,j\in\mathbb Z$. I was able to transform it into:
$$
\frac S 4 -\frac{\pi^2}{12}=\sum_{i=1}^\infty{\sum_{j=1}^\infty \frac{(-1)^{i+j-1}}{i^2+j^2}}
$$
But I'm not sure if it helps. Any help is highly appreciated.

REPLY [6 votes]: Not knowing much about Dirichlet convolution, here's how I derived the result that Jack D'Aurizio mentioned in his answer.
The sum of two squares function has the representation $$ r_{2}(k) = 4 \sum_{d|k} \sin \left(\frac{\pi d}{2} \right).$$
See equation 25.
So $$\sum_{k=1}^{\infty} (-1)^{k-1} \frac{r_{2}(k)}{k}  = 4 \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k} \sum_{d|k} \sin \left(\frac{\pi d}{2} \right).$$
Then assuming we can switch the order of summation,
$$ \begin{align} \sum_{k=1}^{\infty} (-1)^{k-1} \frac{r_{2}(k)}{k} &= 4 \sum_{d=1}^{\infty} \sin \left(\frac{\pi d}{2} \right) \sum_{k \,  \text{such that} \, d|k} \frac{(-1)^{k-1}}{k} \\ &=  4 \sum_{d=1}^{\infty} \sin \left(\frac{\pi d}{2} \right) \sum_{k=1}^{\infty}\frac{(-1)^{kd-1}}{kd} \\ &= 4 \sum_{d=1}^{\infty} \sin \left(\frac{\pi d}{2} \right) \sum_{k=1}^{\infty}\frac{(-1)^{k-1}}{kd} \tag{1} \\ &= 4 \sum_{d=1}^{\infty} \frac{\sin \left(\frac{\pi d}{2} \right)}{d} \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k} \\&= 4 \sum_{d=0}^{\infty} \frac{(-1)^{d}}{2d+1} \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k}\\ &= 4 \left(\frac{\pi}{4} \right) \left(\log 2 \right) \\ &= \pi \log 2. \end{align}$$
$(1)$ When $d$ is even, $\sin \left(\frac{\pi d}{2} \right)$ is zero.