A Perron-like formula From basic Dirichlet series ,if $f(s)=\sum_{n=1}^{\infty}\frac{a_n}{n^s},s=\sigma+it , \sigma>\sigma_0 $  where $\sigma_0$ is the abscissa of convergence, we know that : $$ \sum_{n<x}\frac{a_n}{n^s}=\frac{1}{2\pi i}\int_{c-i\infty}^{c+i \infty}f(s+z) \frac{x^z}{z}dz,  c>0 ,c>\sigma-\sigma_0$$. I tried using some other integrand to create a similar formula and i came to this: $$\frac{1}{\pi}\sum_{n=1}^{\infty}\frac{a_n}{n^s}\log\left(1+\frac{1}{n^2}\right)=$$ $$\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}-\frac{f(s+2z)}{z\sin(\pi z)} dz$$ , for $\Re{z}>0  $ . In order to get the result , one has to compute the integral on the right side. I used as a contour the semicircle from the right side of the vertical line $(c-iT,c+iT)$ which contains the poles $1,2,3,...,n,...$ of the integrand function. I think my result is right , but can somebody confirm it?
 A: If $F(s) = \sum_{k=1}^\infty a_k k^{-s}$ converge abslutely for $Re(s) > 0$ then on $Re(s) > \epsilon$  : $F(s)$ is analytic and $|F(s)| = \mathcal{O}(1)$ so that


*

*For $c \in (0,1)$ and $Re(s) > 0$ : $$\int_{c - i\infty}^{c+i \infty} \frac{F(s+2z)}{z \sin(\pi z)}dz$$
converges absolutely.

*With $R_{c,d,T}$ the boundary of the rectangle $c\pm i T,d \pm i T$ ($d > c,d \not \in \mathbb{Z}$) you have by the residue theorem
$$\int_{R_{c,d,T}}\frac{F(s+2z)}{z \sin(\pi z)}dz = 2i\pi\sum_{n \in (c,d)} Res(\frac{F(s+2z)}{z \sin(\pi z)}, n) = 2i\pi\sum_{n \in (c,d)} (-1)^n\frac{F(s+ 2n)}{n} $$

*and since $ \frac{F(s+2z)}{z \sin(\pi z)}$ decreases exponentially as $Im(z) \to \infty$ and $\int_{d-iT}^{d+iT} \frac{F(s+z)}{z \sin(\pi z)}dz \to 0$ as $d \to \infty$ and that everything converges absolutely, you have
$$\int_{c - i\infty}^{c+i \infty} \frac{F(s+2z)}{z \sin(\pi z)}dz= \lim_{d,T \to \infty}\int_{R_{c,d,T}}\frac{F(s+2z)}{z \sin(\pi z)}dz = 2i\pi\sum_{n=1}^\infty (-1)^n\frac{F(s+2 n)}{ n}  $$ $$= 2i\pi\sum_{k=1}^\infty a_k k^{-s}\sum_{n=1}^\infty(-1)^n \frac{k^{- 2n}}{ n}= 2i\pi\sum_{k=1}^\infty a_k k^{-s} \log(1+k^{-2})$$
The conclusion is that you need $F$ to be analytic, and everything to converges (if it doesn't converge absolutely, you have to be very careful when taking the $\lim_{d, T \to\infty}$ and when inverting $\sum_k \sum_n$)
