I played around with the Fourier series of the Eisenstein series resp. divisor sums and did some calculations, see below. Although the deduction is ***not rigorous / wrong*** (as the power series for the Bernoulli numbers is not convergent), I wonder, why the final result - at least in the area $0<Im(z)\leq \frac{1}{2}$ near the imaginary axis - is still so good? (Even the correction term in case of $E\_2$, i.e. for $m=1$, is matched!).


\begin{equation}
\boxed{\sum\_{n=1}^{\infty}{\sigma\_m(n)\,e(nz)}\approx\frac{B\_{m+1}}{2(m+1)}\left(1-\frac{1}{z^{m+1}}\right)+\left[m=1\right]\frac{1}{2}\frac{1}{2\pi iz}}
\end{equation}


*Can someone give a reason for this behavior, or can someone calculate the error term explicitly?*


For odd $m\in\mathbb{N}$:
\begin{equation\*}
\begin{aligned}
\sum\_{n=1}^{\infty}{\sigma\_m(n)\,e(nz)}&=\sum\_{n=1}^{\infty}{\left(\zeta(m+1)\,n^m\sum\_{q=1}^{\infty}{\frac{c\_q(n)}{q^{m+1}}}\right)e(nz)}\\
&=\zeta(m+1)\sum\_{q=1}^{\infty}{\frac{1}{q^{m+1}}\sum\_{n=1}^{\infty}{\sideset{}{^\star}\sum\limits\_{a\leq q}{n^m\,e\left(z+\frac{a}{q}\right)^n}}}\\
&=\zeta(m+1)\sum\_{q=1}^{\infty}{\frac{1}{q^{m+1}}\sideset{}{^\star}\sum\limits\_{a\leq q}\left(-\frac{1}{2\pi i}\right)^m\frac{\operatorname{d}^m}{\operatorname{d}z^m}\left(\frac{1}{e\left(z+\frac{a}{q}\right)-1}\right)}\\
&=\zeta(m+1)\left(-\frac{1}{2\pi i}\right)^m\frac{\operatorname{d}^m}{\operatorname{d}z^m}\sum\_{q=1}^{\infty}{\frac{1}{q^{m+1}}\frac{1}{2\pi iz}\sum\_{d|q}{\mu\left(\frac{q}{d}\right)}\frac{2\pi i dz}{e(dz)-1}}\\
&=\zeta(m+1)\left(-\frac{1}{2\pi i}\right)^m\frac{\operatorname{d}^m}{\operatorname{d}z^m}\sum\_{q=1}^{\infty}{\frac{1}{q^{m+1}}\frac{1}{2\pi iz}\sum\_{n=0}^{\infty}{\frac{B\_n}{n!}\left(2\pi i z\right)^n
\sum\_{d|q}{\mu\left(\frac{q}{d}\right)d^n}}}\\
&=\zeta(m+1)\left(-\frac{1}{2\pi i}\right)^m\frac{\operatorname{d}^m}{\operatorname{d}z^m}\sum\_{q=1}^{\infty}{\frac{1}{q^{m+1}}\frac{1}{2\pi iz}\sum\_{n=0}^{\infty}{\frac{B\_n}{n!}\left(2\pi i z\right)^n
J\_n(q)}}\\
&=\zeta(m+1)\left(-\frac{1}{2\pi i}\right)^m\frac{\operatorname{d}^m}{\operatorname{d}z^m}\sum\_{n=0}^{\infty}{\frac{B\_n}{n!}\left(2\pi i z\right)^{n-1}\sum\_{q=1}^{\infty}{\frac{J\_n(q)}{q^{m+1}}}}\\ 
&=\zeta(m+1)\left(-\frac{1}{2\pi i}\right)^m\frac{\operatorname{d}^m}{\operatorname{d}z^m}\sum\_{n=0}^{\infty}{\frac{B\_n}{n!}\left(2\pi i z\right)^{n-1}\frac{\zeta(m+1-n)}{\zeta(m+1)}}\\ 
&=-\sum\_{n=0}^{\infty}{\left(\frac{B\_n}{n!}\left(2\pi i z\right)^{n-1-m}\zeta(m+1-n)\prod\_{k\leq m}{\left(n-k\right)}\right)}\\ 
&=\frac{m!}{\left(2\pi iz\right)^{m+1}}\zeta(m+1)-\frac{B\_{m+1}}{(m+1)!}\zeta(0)m!+\left[m=1\right]\frac{1}{2}\frac{1}{2\pi iz}\\
&=\frac{B\_{m+1}}{2(m+1)}\left(1-\frac{1}{z^{m+1}}\right)+\left[m=1\right]\frac{1}{2}\frac{1}{2\pi iz}
\end{aligned}
\end{equation\*}


Notation: $c\_q(n)$ is [Ramanujan's sum](https://en.wikipedia.org/wiki/Ramanujan%27s_sum), $J\_n(q)$ [Jordan's totient function](https://en.wikipedia.org/wiki/Jordan%27s_totient_function), $B\_n$ the [Bernoulli numbers](https://en.wikipedia.org/wiki/Bernoulli_number), $\sideset{}{^\star}\sum\limits\_{a\leq q}{}$ means $\sum\limits\_{\substack{a\leq q\\\gcd(a,q)=1}}{}$, $\left[~\right]$ is the [Iverson bracket](https://en.wikipedia.org/wiki/Iverson_bracket) and $e(z)=e^{2\pi iz}$ as usual.


Numerical Approximations:
Set $f\_m(z):=\sum\_{n=1}^{\infty}{\sigma\_m(n)\,e(nz)},~~~$ $g\_m(z):=\frac{B\_{m+1}}{2(m+1)}\left(1-\frac{1}{z^{m+1}}\right)+\left[m=1\right]\frac{1}{2}\frac{1}{2\pi iz}$


\begin{equation\*}
\begin{aligned}
f\_1\left(\frac{i}{2}\right)&=0.04916444073\\
g\_1\left(\frac{i}{2}\right)&=0.04917839024\\~\\
f\_3\left(\frac{i}{3}\right)&=0.3333338608\\
g\_3\left(\frac{i}{3}\right)&=0.3333333333\\~\\
f\_5\left(\frac{i}{3}-\frac{1}{10}\right)&=-0.1956996617 - 1.099266745\*I\\
g\_5\left(\frac{i}{3}-\frac{1}{10}\right)&=-0.1957162803 - 1.099271842\*I\\~\\
f\_7\left(\frac{i}{\sqrt{7}}+\frac{1}{5}\right)&=-1.365047865 - 1.273191433\*I\\
g\_7\left(\frac{i}{\sqrt{7}}+\frac{1}{5}\right)&=-1.363026857 - 1.272859570\*I\\~\\
\end{aligned}
\end{equation\*}


Another surprising fact is that $g\_1(z),\,g\_3(z)$ and $g\_5(z)$ satisfy [Ramanujan's differential equations](https://en.wikipedia.org/wiki/Eisenstein_series#Ramanujan_identities) for $L(q),\,M(q),\,N(q)$ (as usual $q=e(z)$) as well!


By the way, the corresponding result for Eisenstein series is


\begin{equation}
\boxed{\sum\_{\substack{n,k\in\mathbb{Z}\\\left(n,k\right)\neq\left(0,0\right)}}^{\infty}{\frac{1}{\left(nz+k\right)^{m+1}}}\approx-\left(\frac{2\pi i}{z}\right)^{m+1}\frac{B\_{m+1}}{(m+1)!}+\left[m=1\right]\frac{1}{2z}}
\end{equation}


Best,
M.



Fourier series of Eisenstein series — elegant and very good approximation
As Paul Garrett says, this reflects (for $k \geq 4$ even) the modularity of the Eisenstein series $E\_k(z) = -\frac{B\_k}{2k} + \sum\_{n=1}^{\infty} \sigma\_{k-1}(n) e(nz)$ with respect to the matrix $S = (\begin{smallmatrix} 0 & -1 \\ 1 & 0 \end{smallmatrix})$, which sends $z$ to $-1/z$ (so it preserves the imaginary axis and swaps $0$ and $i\infty$). For $m \geq 3$ odd, writing $E\_{m+1} |\_{m+1} S = E\_{m+1}$ you get an asymptotic expansion of $E\_{m+1}(z)$ at $z=0$, which agrees with what you wrote. For $m=1$ the Eisenstein series $E\_2$ is only quasi-modular, but you can also work out the asymptotic expansion.


The integer $m$ should be odd, because $E\_k(z)$ has no modularity property whatsoever for $k$ odd.


