Infinite sum involving number of solutions to $k=i^2+j^2$ 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.
 A: For any $a,b\in\mathbb{N}\setminus\{0\}$ we have:
$$ \int_{0}^{+\infty}\frac{\sin(ax)}{a} e^{-bx}\,dx = \frac{1}{a^2+b^2}\tag{1}$$
so by multiplying both sides of $(1)$ by $(-1)^a (-1)^b$ and summing over $a\in[1,+\infty),b\in[1,+\infty)$ we get:
$$\sum_{a,b\geq 1}\frac{(-1)^{a+b}}{a^2+b^2}=\int_{0}^{+\infty}\frac{\text{Im}\log(1+e^{ix})}{1+e^x}\,dx=\frac{\pi^2}{24}-\sum_{k=1}^{+\infty}\pi k\int_{(2k-1)\pi}^{(2k+1)\pi}\frac{dx}{1+e^x}\tag{2}$$
and:
$$\begin{eqnarray*}\sum_{k=1}^{+\infty}\pi k\int_{(2k-1)\pi}^{(2k+1)\pi}\frac{dx}{1+e^x}&=&\pi\sum_{k=0}^{+\infty}\log\left(1+e^{-(2k+1)\pi}\right)\\&=&\pi\log\prod_{k\geq 0}\left(1+e^{-(2k+1)\pi}\right)\\&=&\pi\log\left(2^{1/4}e^{-\pi/24}\right)\tag{3}\end{eqnarray*}$$
where the last identity is kindly provided by a special value of the Dedekind eta function.
$$ S = \pi\log 2 \tag{4}$$
readily follows. 

Another possible approach is given by noticing that $(-1)^k r_2(k)$ is four times a multiplicative function, hence, by Dirichlet convolution:
$$ S = 4\left(\sum_{n\geq 1}\frac{(-1)^n}{2n-1}\right)\cdot\left(\sum_{n\geq 1}\frac{(-1)^n}{n}\right)=4\cdot\frac{\pi}{4}\cdot\log 2.\tag{5}$$
A: We note the estimate of the summation function of $r_{2}(n)$:
$$S(n) = \sum\limits_{k=1}^{n} r_2(k) = \pi n + \mathcal{O}(\sqrt{n})$$
where, $S(n)$ is the number of integer points inside the disk of radius $\sqrt{n}$.
Since, $k = i^2+j^2 \iff 2k = (i+j)^2+(i-j)^2$, we have, $r_2(2k) = r_2(k)$.
Hence, $$\displaystyle \sum\limits_{k=1}^{2n} (-1)^{k-1}\frac{r_2(k)}{k} = \sum\limits_{k=1}^{2n}\frac{r_2(k)}{k} - 2\sum\limits_{k=1}^{n}\frac{r_2(2k)}{2k} = \sum\limits_{k=n+1}^{2n} \frac{r_2(k)}{k}$$
Now, by Abel Summation identity: $$\begin{align} \sum\limits_{k=n+1}^{2n} \frac{r_2(k)}{k} &= \sum\limits_{k=n}^{2n} \left(\frac{1}{k} - \frac{1}{k+1}\right)S(k) + \frac{S(2n)}{2n+1} - \frac{S(n)}{n} \\ &= \sum\limits_{k=n}^{2n} \frac{S(k)}{k(k+1)} + \frac{S(2n)}{2n+1} - \frac{S(n)}{n}\end{align}$$
Since, $\displaystyle \frac{S(n)}{n} = \pi + \mathcal{O}(n^{-1/2})$
$$\begin{align} \sum\limits_{k=n}^{2n} \frac{S(k)}{k(k+1)}&= \pi\sum\limits_{k=n}^{2n}\frac{1}{k+1} + \mathcal{O}\left(\sum\limits_{k=n}^{2n}\frac{1}{k^{1/2}(k+1)}\right)\\&=\pi\sum\limits_{k=n}^{2n}\frac{1}{k+1} + \mathcal{O}(n^{-1/2}) \end{align}$$
Hence, $$\sum\limits_{k=1}^{2n} (-1)^{k-1}\frac{r_2(k)}{k} = \pi\sum\limits_{k=n}^{2n}\frac{1}{k+1} + \mathcal{O}(n^{-1/2})$$
i.e., $$\sum\limits_{k=1}^{\infty} (-1)^{k-1}\frac{r_2(k)}{k} = \pi\log 2$$
A: 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.
A: I suppose we could start with the fact that: $$r_2(n) = 4(d_{1,4}(n) - d_{3,4}(n))$$
where, $d_{a,b}(n)$ is the number of divisors of $n$ that are congruent to $a\pmod{b}$.
Hence, $\displaystyle \sum\limits_{n=1}^{\infty} r_2(n)x^n = 4\sum\limits_{n=0}^{\infty} (-1)^{n}\frac{x^{2n+1}}{1-x^{2n+1}}$
Thus, $$\displaystyle \begin{align}\sum\limits_{n=1}^{\infty} (-1)^{n-1}\frac{r_2(n)}{n} &= 4\sum\limits_{n=0}^{\infty} (-1)^{n-1}\int_0^{-1} \frac{x^{2n}}{1-x^{2n+1}}\,dx \\&= 4\sum\limits_{n=0}^{\infty} (-1)^{n}\frac{\log (1-(-1)^{2n+1})}{2n+1}\\&= 4\log 2\sum\limits_{n=0}^{\infty} \frac{(-1)^{n}}{2n+1} = \pi\log 2\end{align}$$
