%~Mouliné par MaN_auto v.0.34.0 (b0f8651d) 2025-07-03 09:11:06
\documentclass[CRPHYS,Unicode,biblatex,published]{cedram}

\addbibresource{CRPHYS_Montambaux_20250328.bib}

\usepackage{subcaption}
\usepackage[np]{numprint}

\newcommand{\mm}{m_e}
\newcommand{\ep}{{\epsilon}}
\newcommand{\rr}{{\omega}}

\newcommand*{\dd}{\mathrm{d}}

\DeclareMathOperator{\osc}{osc}
\DeclareMathOperator{\ci}{Ci}
\DeclareMathOperator{\si}{Si}

%%%---------------------------------------------------------------------------

%%% ARROWS

\newcommand\limite[1]{\ \xrightarrow[#1]{} \ }
\newcommand\limiteup[1]{\ \overset{#1}{\longrightarrow} \ }

%%%---------------------------------------------------------------------------

%%% DELIMITERS

\usepackage{mathtools}
\DeclarePairedDelimiter{\parens}{\lparen}{\rparen}
%\DeclarePairedDelimiter{\braces}{\{}{\}}
%\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
%\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
%\DeclarePairedDelimiter{\tnorm}{\VERT}{\VERT}
\DeclarePairedDelimiter{\bracks}{[}{]}
%\DeclarePairedDelimiter{\bbracks}{\llbracket}{\rrbracket}
\DeclarePairedDelimiter{\angles}{\langle}{\rangle}
%\DeclarePairedDelimiter{\aangles}{\langle\!\langle}{\rangle\!\rangle}
%\DeclarePairedDelimiter{\pparens}{(\!(}{)\!)}

%%%---------------------------------------------------------------------------

\graphicspath{{./figures/}}

\newcommand*{\mk}{\mkern -1mu}
\newcommand*{\Mk}{\mkern -2mu}
\newcommand*{\mK}{\mkern 1mu}
\newcommand*{\MK}{\mkern 2mu}

\hypersetup{urlcolor=purple, linkcolor=blue, citecolor=red}

%%%---------------------------------------------------------------------------

\makeatletter
\def\@setafterauthor{%
  \vglue3mm%
\begingroup\hsize=12cm\advance\hsize\abstractmarginL\raggedright
\noindent
   \leftskip\abstractmarginL
  \normalfont\Small
  \@afterauthor\par
\endgroup
\vskip2pt plus 3pt minus 1pt
}
\makeatother

%%%---------------------------------------------------------------------------


\title{Ramanujan, Landau and Casimir, divergent series: a physicist approach}
\alttitle{Ramanujan, Landau et Casimir, les s\'eries divergentes\tralicstex{}{ }: l'approche d'un physicien}

\author{\firstname{Gilles} \lastname{Montambaux}}
\address{Laboratoire de Physique des Solides, Universit\'e Paris-Saclay, CNRS UMR 8502, 91405 Orsay, France}
\email{gilles.montambaux@universite-paris-saclay.fr}

\keywords{\kwd{Infinite series} \kwd{Ramanujan} \kwd{Landau} \kwd{Casimir}}
\altkeywords{\kwd{Séries infinies} \kwd{Ramanujan} \kwd{Landau} \kwd{Casimir}}

\begin{abstract}
It is a popular paradoxical exercise to show that the infinite sum of positive integer numbers is equal to \tralicstex{--1/12}{$-1/12$}, sometimes called the Ramanujan sum. This result is actually well-defined in a proper mathematical sense. Here we propose a qualitative approach, much like that of a physicist, to show how the value \tralicstex{--1/12}{$-1/12$} can make sense and, in fact, appears in certain physical quantities where this type of summation is involved. At the light of two physical examples, taken respectively from condensed matter --~the Landau diamagnetism~-- and quantum electrodynamics --~the Casimir effect~-- that illustrate this strange sum, we present a systematic way to extract this Ramanujan term from the infinity. In both examples, the ``infinite'' appears to be a vacuum energy and the Ramanujan sum is revealed by a response function to an external parameter.
\end{abstract}

\begin{altabstract}
On présente souvent comme un paradoxe le fait que la somme infinie des entiers positifs puisse être égale à \tralicstex{--1/12}{$-1/12$}, ce que l'on appelle parfois la somme de Ramanujan. Ce résultat est en réalité bien défini dans un certain cadre mathématique rigoureux. Ici, nous proposons une approche qualitative, semblable à celle utilisée en physique, pour montrer comment la valeur \tralicstex{--1/12}{$-1/12$} peut avoir un sens, et comment elle apparaît concrètement dans certaines grandeurs physiques faisant intervenir ce type de sommation. À travers deux exemples physiques, l’un issu de la matière condensée --~le diamagnétisme de Landau~-- et l’autre de l’électrodynamique quantique --~l’effet Casimir~-- qui illustrent cette somme étrange, nous présentons une méthode systématique permettant d’extraire ce terme de Ramanujan de l’infini. Dans les deux cas, l’\og infini \fg{} correspond à une énergie du vide, et la somme de Ramanujan se révèle via une fonction de réponse à un paramètre externe.
\end{altabstract}

\dateposted{2025-07-28}
\begin{document}

\maketitle

\medskip

Consider the sum of natural numbers:
\begin{equation}
s(n) = 1 + 2 + 3 + 4 + 5 + \dotsb + n.
\end{equation} 
For the first $n$ numbers, this sum has been calculated by young Gauss who found that
\begin{equation} 
s(n) = \frac{n (n+1)}{2} 
\end{equation} which of course goes to infinity when $n \rightarrow \infty$. But certain ways to calculate this \emph{infinite} sum lead to the result written in a fancy form:
\begin{equation}\label{Rama1}
s(\infty) = 1 + 2 + 3 + 4 + 5 + \dotsb \ \longrightarrow \ - \frac{1}{12}.
\end{equation} 

How can the infinite sum of positive numbers be finite and negative?!

One can get this strange result by a subtle manipulation of infinite sums, as proposed by Ramanujan (see a brief reminder in Appendix~\ref{app.Ramanujan}). The problem is that this manipulation is poorly defined: if one subtracts two infinite sums, what meaning does their difference have? This difficulty was highlighted by Ramanujan in his letter to Hardy~\cite{Ramanujan_wiki}, and much earlier, this type of result had been obtained by Euler. In the following, we give the result of~\eqref{Rama1} and other infinite sums the name of \emph{Ramanujan sum} and will label them with the letter $\mathcal R$.

By appropriate regularisations, mathematicians have shown ways to give a correct signification to this strange result. A regularisation is precisely a way to define the infinity, and extract a finite number from this infinity. In some sense, this sum is equal to ``$\text{infinity} -1/12$''. Furthermore, it is related to the Riemann $\zeta$ function:
\begin{equation}
\zeta(x)= \sum_{n=1}^\infty \frac{1}{n^x}
\end{equation}
which is well-defined for $x>1$ but diverges otherwise. Riemann extended its definition to negative (and complex) arguments using a method called analytic continuation, yielding the result $\zeta(-1)=-1/12$.

In this paper, we develop a tutorial presentation to understand the nature of this $-1/12$, by taking two examples of physical quantities where this kind of infinite sum appears. One is the Landau diamagnetism of free electrons. The other is the energy of vacuum associated with the Casimir effect.

Landau diamagnetism, the orbital reponse of a free electron gas to a magnetic field, is accompanied by quantum oscillations when the field varies. The usual treatment of these oscillations provides an interesting clue to qualitatively understand the separation between the ``infinity'' and the $-1/12$ contribution. This is developed in the next section. In a magnetic field, due to the quantization of the electronic spectrum into discrete Landau levels, the variation of the total energy with the Fermi energy exhibits a step-like behavior. By analysis of this behavior and using the Poisson summation formula, one separates the energy into three parts: a zero-field energy, an oscillating term known as de Haas--van Alphen oscillations, and a non-oscillating term proportional to $1/12$. This last term, the Landau diamagnetism, is a manifestation of a Ramanujan sum revealed by the magnetic field and it shows how an infinite sum is involved in a physical phenomenon.

Then we follow the same type of systematic analysis for various infinite series to extract their Ramanujan sum. Using the same recipe for various infinite series, we separate the infinity in two parts, a power law which tells us how the sum scales to infinity and a correction to this infinite sum identified with the Ramanujan sum. This is done in Sections~\ref{sect.integers}--\ref{sect.other}.

The Casimir pressure is an attractive force between two metallic plates resulting from vacuum fluctuations of the electromagnetic field. In Section~\ref{sect.Casimir}, we discuss the Casimir effect in which this kind of sum appears, first in a tutorial one-dimensional example, then in three dimensions.

In conclusion, we argue that the ``infinite'' sum appears to be a vacuum energy (the energy of the filled Fermi sea in the case of electrons), and the Ramanujan sum appears in the response to an external parameter, the magnetic field in the case of diamagnetism, the variation of thickness between the plates in the Casimir effect. We stress the pedagogical analogy between the two calculations.

\section{Landau diamagnetism}

\begin{figure}[h!]
\includegraphics[width=6cm]{spectre-landau.jpg}
\caption{Density of states of 2D free electrons. Blue: zero field. In a magnetic field, the quantum states condense into Landau levels, of energy $(n+1/2)\hbar \omega_c$ and degeneracy $eB/h$.}\label{fig:spectre-landau}
\end{figure}

We consider the total energy of a two-dimensional (2D) electron gas. Due to Fermi principle, the electron states are populated up to an energy called the Fermi energy $\ep_F$ which depends on the electron density. Figure~\ref{fig:spectre-landau} recalls how the electronic states are populated. For each energy there is a finite and constant density of states given by (we do not consider spin degeneracy):
\begin{equation}\label{energy1}
\nu(\ep) = \frac{\mm}{2 \pi \hbar^2}.
\end{equation} 
The total energy is therefore
\begin{equation} E(\ep_F)= \int_0^{\ep_F} \nu(\ep)\, \ep \,\dd\ep = \frac{\mm}{4 \pi \hbar^2}\ep_F^2. 
\end{equation}
In a magnetic field, Landau showed that the energy can take only a discrete set of values. Quantum states coalesce into the so-called Landau levels with energy (Figure~\ref{fig:spectre-landau}):
\begin{equation} 
\ep_n = \parens[\Bigg]{n+\frac{1}{2}} \hbar \omega_c 
\end{equation} 
where $\omega_c = {e B / \mm}$ is the cyclotron frequency. The total density of quantum states being conserved, each Landau level has a degeneracy ${e B /h}$ per unit area. The total energy now reads as a discrete sum:
\begin{equation}\label{EeFB}
E(\ep_F)= \frac{e B}{h} \parens{1 + 3+ 5 + 7 + 9 + \dotsb} \frac{\hbar \omega_c}{2} 
\end{equation} 
with $\ep_n < \ep_F$. Therefore we have to calculate the infinite sum of odd numbers (this is a problem slightly different from the one of the sum of natural numbers that will be considered below). The sum is actually not infinite but cut by the Fermi energy $\ep_F$. We are interested in the dependence $E(\ep_F)$ that we write in the form:
\begin{equation}\label{energyT0}
E(\ep_F)= \frac{\mm \omega_c^2}{2 \pi} \sum_{n \geq 0} \parens[\Bigg]{n+\frac{1}{2}} \, \Theta\bracks[\Bigg]{\ep_F - \parens[\Bigg]{n+\frac{1}{2}} \hbar \omega_c}
\end{equation} 
where $\Theta(x)$ is the Heaviside function. As seen on Figure~\ref{fig:energie-landau}, this sum has a step-like dependence in the Fermi energy (experimentally, the Fermi energy is rather fixed and the oscillations are seen when varying the magnetic field). This step-like behavior leads to oscillations of the magnetization known as de Haas--van Alphen oscillations~\cite{Landau,Landau_2,Shoenberg}.

\begin{figure}[h!]
\includegraphics[width=8cm]{energie-landau.jpg}
\caption{Total energy (in units of $\frac{\mm \omega_c^2}{2 \pi}$) of 2D electron gas in a magnetic field, as function of the ratio $\ep_F/\hbar \omega_c$. $T=0K$: black steps. Finite temperature $k_B T \ll \hbar \omega_c$: blue curve. At temperature $T$ such that $\hbar \omega_c \ll k_BT \ll \ep_F$, one recovers the zero field quadratic increase, with a small field dependent correction, not visible at this scale (red curve).}\label{fig:energie-landau}
\end{figure}

To highlight and characterize these oscillations, it is common to use the Poisson summation formula (Appendix~\ref{app.Poisson}) to obtain:\footnote{Textbooks usually rather consider the grand potential at finite temperature. The energy can be deduced with appropriate derivative of the grand potential~\cite{Shoenberg}.}
\begin{equation}\label{EeFpoisson}
E(\ep_F) = \frac{\mm \omega_c^2}{2 \pi} \parens*{\frac{1}{2} \parens[\Bigg]{\frac{\ep_F}{\hbar \omega_c}}^2 + \sum_{m \geq 1} (-1)^m \frac{\cos 2 \pi m x + 2 \pi m x \, \sin 2 \pi m x -1}{2 (\pi m)^2}}
\end{equation}
where $x=\ep_F/\hbar \omega_c$. Examination of this formula shows three types of contribution: (a) the first term is the zero field total energy; (b) the oscillatory terms are signatures of the step-like form of the total energy vs.\ Fermi energy; (c) there is an additional non-oscillating term, dependent on the magnetic field, proportional to the sum
\begin{equation}
\frac{1}{2} \sum_{m = 1}^\infty \frac{(-1)^{m+1}}{(\pi m)^2} = \frac{1}{24}.
\end{equation}
We can summarize the result in the form:
\begin{equation} E(\ep_F)= \frac{\mm \ep_F^2}{4 \pi \hbar^2} + \frac{e^2 B^2}{2 \pi \mm} \parens[\Bigg]{\frac{1}{24}+ \osc(\ep_F / \hbar\omega_c)}
\end{equation} 
where $\osc(x)$ scales as $x$ and $\angles[\big]{\osc(x)/x}=0$. The average is taken over a large ($\gg 1$) range of $x$. As we recall later, the quantum oscillations are damped by temperature or disorder, so that only the two first terms remain. The Landau susceptibility is given by the second derivative of the energy with respect to the magnetic field:
\begin{equation}\label{Landauchi}
\chi = -\frac{\partial^2 E}{\partial B^2} = -\frac{e^2}{24 \pi \mm}. 
\end{equation}
We see clearly that this diamagnetic term has its origin in an infinite series~\eqref{EeFB} of odd numbers, very similar to the series~\eqref{Rama1}, the main subject of this paper. One can say here that the Ramanujan sum of this infinite series is revealed by the magnetic field. Indeed there are two characteristic energy scales in this problem, the Fermi energy which drives the infinity and the cyclotron energy which gives the correction to this infinity. This physical separation will be very useful in the following discussion. Taking $\hbar=1$, $\mm=2 \pi$, and $\omega_c=b$, the sum~\eqref{EeFB} gets the form, omitting the oscillations:
\begin{equation}\label{epb}
b^2 \parens[\Bigg]{\frac{1}{2} +\frac{3}{2}+\frac{5}{2} + \dotsb +\frac{\ep}{b}} \limite{b \rightarrow 0} \frac{\ep^2}{2} + \frac{b^2}{24}.
\end{equation}
The notation~\eqref{epb} is precious for physicists because we see that, with the help of \emph{two characteristic scales}, we describe both the behavior at infinity and the Ramanujan sum. As we see now, a third scale is needed to properly suppress the oscillations.

\subsection*{Damping of the oscillations}

The oscillations occur because of the sharp cut-off at the Fermi energy, when the temperature $T=0$. At finite temperature, this discontinuity is smoothed and the Heaviside function is replaced by a Fermi--Dirac factor:\footnote{Actually $\chi_\beta(\ep_F -\ep_n)=1 - f(\ep_n)$ where $f(\ep_n)$ is the Fermi factor with an inverse temperature $\beta$ and a Fermi energy $\ep_F$.}
\begin{equation}
\Theta(\ep_F -\ep_n) \ \longrightarrow \ \chi_\beta(\ep_F -\ep_n) \equiv \frac{1}{e^{\beta(\ep_F-\ep_n)}+1}
\end{equation} 
where $\beta=1/k_B T$ with $k_B T \ll \ep_F$. As temperature increases, the oscillatory terms in the sum~\eqref{EeFpoisson} are progressively reduced and disappear when $\hbar\omega_c \ll 1/\beta$ (Figure~\ref{fig:energie-landau}). For example, at finite temperature ($\hbar = 1$),
\begin{equation} 
\cos 2 \pi m \frac{\ep_F}{\omega_c} \ \longrightarrow \ R(Z_m) \ \cos 2 \pi m \frac{\ep_F}{\omega_c} 
\end{equation} 
where the reduction factor $R(Z_m)$ is given by
\begin{equation}
R(Z_m)= \frac{\pi Z_m}{\sinh \pi Z_m} \quad \text{with} \ Z_m=\frac{2 m \pi^2}{\beta \omega_c}.
\end{equation}
Note that the power-law and the susceptibility are not affected by the temperature as long as $1/\beta \ll \ep_F$. As discussed in~\cite{Shoenberg} and in Appendix~\ref{app.damping}, the oscillations can be damped by other factors like impurity scattering.

\subsection*{Conclusion of this section}

We summarize the procedure used to extract the Landau susceptibility as a Ramanujan sum. We have replaced the sum over Landau levels (odd numbers) by a step function. This step function has three components, a power law which tells how the sum scales when the Fermi energy goes to infinity, an oscillatory behavior, and the field dependent (but $\ep_F$ independent) term which corresponds to a Ramanujan sum. In dimensionless units, we transform~\eqref{epb} and we conclude that the sum of odd numbers scales as:
\begin{equation}\label{odd-numbers}
1+3+5+7+ \dotsb + x \limite{x \rightarrow \infty} {\frac{x^2}{4}} + \frac{1}{12}.
\end{equation}
In the following, we apply the same procedure to study various infinite sums.

\section{Infinite sum of integer numbers}\label{sect.integers}

We now come to our original problem. Consider the sum of natural numbers. The same procedure as above is used to show that, in the sense of Ramanujan:
\begin{equation} 
s(\infty) = 1 + 2 + 3 + 4 + 5 + \dotsb \limiteup{\mathcal R} - \frac{1}{12}. 
\end{equation}
Inspired by the Landau problem, we define a step function $S(x)$ that jumps to the value $s(n)$ for each integer $n$. This function $S(x)$ is an oscillating function that oscillates between the values $x(x+1)/2$ and $x(x-1)/2$ (see Figure~\ref{fig:sn}). How can we define the average behavior of $S(x)$ as $x$ tends to infinity? For example, this could be the average between the two continuous curves, i.e., $x^2/2$. A systematic approach proposed here is to decompose this oscillating function into harmonics as in the Landau calculation and then remove all harmonics to obtain an average value $\angles[\big]{S(x)}$. The function $S(x)$ is expressed as:
\begin{equation}\label{n-theta}
S(x)= \sum_1^\infty n \ \Theta(x-n) 
\end{equation} 
where $\Theta(x)$ is the Heaviside step function.

\begin{figure}[h!]
\includegraphics[width=8cm]{fig-s1n1.pdf}
\caption{Red dots: discrete values $s(n)$. Green: the step function $S(x)$. Black: the functions $x(x+1)/2$ and $x(x-1)/2$. Blue: the function $x^2/2-1/12$.} \label{fig:sn}
\end{figure}

\begin{figure}[h!]
\includegraphics[width=6cm]{fig-s1n-3-5.pdf}
\hfill
\includegraphics[width=6cm]{fig-s1n-3-1.pdf} \\
\vskip .5\baselineskip
\includegraphics[width=6cm]{fig-s1n-3-0.pdf}
\caption{Fit of the function $S(x)$ by the Fourier series, limited here to $5$ terms, then to a single term, and then with no harmonics. In black, without the factor $-1/12$; in blue, with the factor $-1/12$ (the difference is barely visible).} \label{fig:sn2}
\end{figure}

The Fourier transform allows us to express it as a sum of periodic functions. This way, we can separate an average behavior that tells us how this function behaves as it tends to infinity, from an oscillating behavior. Poisson's summation formula enables us to show that (see Appendix~\ref{app.Poisson})
\begin{equation}\label{F1} 
S(x)= {\frac{x^2}{2}} + 2 \sum_{m=1}^\infty \bracks[\Bigg]{\frac{x \sin 2 \pi m x}{2 \pi m}+\frac{\cos 2 \pi m x - 1}{(2 \pi m)^2}}. 
\end{equation} 
The first term tells us how the function behaves as it tends to infinity. In addition, we see that in this sum, there exists a non-oscillating contribution:
\begin{equation} 
- 2 \sum_{m=1}^\infty \frac{1}{(2 \pi m)^2} = -\frac{1}{12}
\end{equation} 
which is the Ramanujan sum of naturals. Thus, $S(x)$ is the sum of a monotonic average contribution and an oscillating function $\osc(x)$:
\begin{equation} 
\boxed{S(x)= {\frac{x^2}{2}} - \frac{1}{12} + \osc(x)}
\end{equation} 
which is shown on Figure~\ref{fig:sn2}. We have learned in the previous section that the oscillations can be removed by replacing the Heaviside function $\Theta(x-n)$ by a smoothed function $\chi_\beta(x-n)$ with $1 \ll 1/\beta \ll x$.

For completion, we recall here the sum of odd numbers, obtained from the Landau calculation~\eqref{odd-numbers}.
\[
\boxed{{1} + {3} + {5} + {7} + \dotsb \limiteup{\mathcal R} \frac{1}{12}}
\]
and the sum of even numbers is obviously
\[
\boxed{{2} + {4} + {6} + {8} + \dotsb \limiteup{\mathcal R} -\frac{1}{6}}
\]

\section{Sum of squares, even powers}\label{sect.squares}

We now proceed similarly for the sum of squares to show that:
\begin{equation} 
s_2= 1 + 4 + 9 + 16 + 25 + \dotsb \limiteup{\mathcal R} 0 !!.
\end{equation} 
Let's see how our method works. Following the same procedure as before, we calculate the function
\begin{equation}\label{S2x}
S_2(x)= \sum_{n=1}^\infty n^2 \ \Theta(x-n). 
\end{equation} 
Its Fourier decomposition is
\begin{equation}\label{F2}
S_2(x)={\frac{x^3}{3}} +2 \sum_{m=1}^\infty \bracks[\Bigg]{\frac{x^2\sin 2 \pi m x}{2 \pi m} + \frac{2 x \cos 2 \pi m x}{(2 \pi m)^2}-2 \frac{\sin 2 \pi m x}{(2 \pi m)^3}}.
\end{equation}
We see that this sum does not contain a constant term:
\begin{equation} \boxed{S_2(x) = {\frac{x^3}{3}} + 0 + \osc(x)} \end{equation} In the same sense as above, one can say that the Ramanujan sum $s_2(\infty)=0 !!$.

Using the same procedure, one can show that all sums of even power of integer numbers are zero in the sense of Ramanujan. As recalled in Appendix~\ref{app.Poisson}, this corresponds to the trivial zeros on the zeta function.

\section{Sum of odd powers}\label{sect.odd}

Let's now show that:
\begin{equation} 
s_3= 1 + 8 + 27 + 64 + 125 + \dotsb \limiteup{\mathcal R} {\frac{1}{120}} !!.
\end{equation} 
As we will see in Section~\ref{sect.Casimir}, it is this sum that is involved in the Casimir effect. We calculate the function
\begin{equation}\label{S3x}
S_3(x)= \sum_{n=1}^\infty n^3 \ \Theta(x-n). 
\end{equation} 
Its Fourier expansion, which contains oscillating terms that we do not detail (see Appendix~\ref{app.Poisson}) and two non-oscillating terms, is of the form
\begin{equation}\label{F3}
S_3(x) = {\frac{x^4}{4}} + {\sum_{m=1}\frac{12}{(2 \pi m)^4}} + \osc(x)= {\frac{x^4}{4}} {+ \frac{1}{120}} + \osc(x).
\end{equation} 
Similarly,
\begin{equation}\label{F5}
S_5(x) = {\frac{x^6}{6}} {- \sum_{m=1}\frac{240}{(2 \pi m)^6}} + \osc(x)= {\frac{x^6}{6}} {- \frac{1}{252}}+\osc(x)
\end{equation} 
and
\begin{equation}\label{F7}
S_7(x) = {\frac{x^8}{8}} {+ \sum_{m=1}\frac{\np{10080}}{(2 \pi m)^8}} + \osc(x)= {\frac{x^8}{8}}{+ \frac{1}{240}} + \osc(x), 
\end{equation}
which generalizes, for an odd power $p=2 k -1$:
\begin{equation} 
S_{2 k -1}(x) = {\frac{x^{2 k}}{2 k}} +{(-1)^k \sum_{m=1}^\infty \frac{2 (2k-1)!}{(2 \pi m)^{2k}}} + \osc(x).
\end{equation} 
The constant term is nothing but the $\zeta$ function taken in $1-2k$:
\begin{equation} 
S_{2 k -1}(x) = {\frac{x^{2 k}}{2 k}} + {\zeta(1-2 k)} + \osc(x).
\end{equation}
We can now summarize our result obtained for even or odd powers of naturals in the form:
\begin{equation}\label{Spx} 
\boxed{S_{p}(x) = {\frac{x^{p+1}}{p+1}} + {\zeta(-p)} + \osc(x)}
\end{equation}

\section{Other sums}\label{sect.other}

We now proceed similarly to calculate sums which are not convergent and ill-defined. Then we reconsider the case of two convergent series.

\subsection{Infinite sum of ones}

\[
\boxed{\boldsymbol s_0= 1 + 1 + 1 + 1 + 1 + \dotsb \limiteup{\mathcal R} -\frac{1}{2}}
\]
Again, how the sum of positive numbers can be negative!

We define the function $S_0(x)$, and we seek its Fourier expansion to extract its average behavior:
\begin{equation}\label{S0x}
S_0(x)= \sum_{n=1}^\infty \Theta(x-n)= {x} {-\frac{1}{2}} + \sum_{m=1}^\infty \frac{\sin 2 \pi m x}{\pi m}. 
\end{equation}
The Ramanujan sum of ones is $-1/2$.

\subsection{Alternating sum of integer numbers}

\[
\boxed{1-2+3-4+5-6+ \dotsb \limiteup{\mathcal R} \frac{1}{4}}
\]
Here, we consider the alternating sum of the integers, denoted as $B$ in Appendix~\ref{app.Ramanujan}:
\begin{equation} 
B= 1 - 2 + 3 - 4 + 5 - 6 + \dotsb 
\end{equation} 
We introduce the function:
\begin{equation}\label{Bdexdef}
B(x) = \sum_{n=1}^\infty n \, \cos\parens[\big]{(n+1)\pi}\, \Theta(x-n). 
\end{equation} 
By retaining only the non-oscillating terms of the Fourier expansion, we find:
\begin{equation}
B(x) = {\frac{1}{\pi^2} \sum_{\substack{m=1 \\ k=\pm 1}}^\infty \frac{1}{(2m+k)^2}}+ \osc(x) = {\frac{1}{4}}+ \osc(x).
\end{equation}
The alternate sum of integers is $1/4$.

\subsection{Grandi series}

The so-called Grandi's sum is:
\begin{equation} 
A= 1 - 1 + 1 - 1 + 1 - 1 + \dotsb 
\end{equation} 
We introduce the function:
\begin{equation} 
A(x) = \sum_{n=1}^\infty \cos\parens[\big]{(n+1)\pi} \, \Theta(x-n) 
\end{equation} 
whose Fourier expansion is:
\begin{equation}
A(x) = {\frac{1}{2}} - \frac{\sin \pi x}{\pi} - \sum_{\substack{m=1 \\ k=\pm 1}}^\infty \frac{\sin (2 m +k) \pi x}{(2m+k) \pi} = {\frac{1}{2}}+ \osc(x)
\end{equation}
so that we can write:
\[
\boxed{1 - 1 + 1 - 1 + 1 - 1 + \dotsb \limiteup{\mathcal R} \frac{1}{2}}
\]

\subsection{Harmonic series}

We continue to use the same method to calculate the sum of the series:
\[
\boxed{1 + \frac{1}{2} + \frac{1}{3}+ \frac{1}{4} + \dotsb \limiteup{\mathcal R} {\ln x}+{\gamma}}
\]
where $\gamma$ is the Euler constant. We introduce the function:
\begin{equation} 
S_{-1}(x) = \sum_{n=1}^\infty \frac{1}{n} \, \Theta(x-n)
\end{equation} 
whose Fourier expansion is:
\begin{equation} 
S_{-1}(x)= {\ln x} + \frac{1}{2} + 2 \sum_{m=1}^\infty \bracks[\big]{\ci(2 m \pi x) - \ci(2 m \pi)}
\end{equation} 
where $\ci$ is the cosine integral function. It satisfies the sum $\sum_{m=1}^\infty \ci(2 m \pi)= 1/4 - \gamma/2$. Therefore,
\begin{equation} 
S_{-1}(x)= {\ln x}+ {\gamma}+ \osc(x).
\end{equation}

\subsection{The Basel problem}

\[
\boxed{1 + \frac{1}{2^2} + \frac{1}{3^2}+ \frac{1}{4^2} + \dotsb \ = \ \frac{\pi^2}{6}}
\]
We finish with the famous ``Basel problem'' studied by Euler. Here, the infinite sum is convergent. Can we still use our method?

We introduce the function:
\begin{equation}
S_{-2}(x) = \sum_{n=1}^\infty \frac{1}{n^2} \, \Theta(x-n)
\end{equation}
whose Fourier expansion is:
\begin{equation}
S_{-2}(x)=\frac{3}{2}-\frac{1}{x} + 2 \sum_{m=1}^\infty \parens[\Bigg]{1 - \frac{\cos(2 \pi m x)}{x} + 2m \pi \bracks[\big]{\si(2 m \pi)- \si(2 m \pi x)}}
\end{equation}
where $\si$ is the sine integral function which verifies $\si(2 m \pi x) \rightarrow \frac{\pi}{2}$ if $x \rightarrow \infty$. Therefore, $S_{-2}$ converges to the value:
\begin{equation} 
S_{-2}(\infty)= \frac{3}{2}+ 2 \sum_{m=1}^\infty \bracks[\big]{1 + 2m \pi \si(2 m \pi)-m \pi^2}
\end{equation}
and we have checked (numerically) that this sum is indeed ${\pi^2 / 6}$.

\section{Back to physics: Casimir force}\label{sect.Casimir}

We now come back to physics, with a brief description of the Casimir effect and its connection with a Ramanujan sum.

\subsection{Introduction}

The Casimir effect is a manifestation of vacuum fluctuations of the electromagnetic field. The total energy of the field is a sum over electromagnetic modes of frequencies $\omega$:
\begin{equation}
E= \sum_{\mathrm{modes}} \parens[\Bigg]{n(\omega,T) +\frac{1}{2}} \hbar \omega.
\end{equation}
The first term is the contribution of the modes excited at finite temperature; $n(\omega,T)$ is the Bose factor. The summation over modes leads to the well-known result, per volume unit:
\begin{equation} 
E(T)= \frac{\pi^2}{15} \frac{(k_B T)^4}{(\hbar c)^3}. 
\end{equation} 
This is the well-known energy of the black-body, which vanishes at zero temperature. The second term is more delicate since it is an infinite contribution of modes. It is thus infinite (and temperature independent). We now consider this second term, first in a rather academic 1D geometry, then in three dimensions.

\subsection{Casimir effect in one dimension}

It is instructive to start with a 1D calculation, since it is very similar to the Landau calculation. We consider the space confined between two points distant of $a$. The sum is given by
\begin{equation} 
E=\frac{1}{2} \sum_{n=0}^\infty \hbar \omega_n 
\end{equation} 
where the frequency of the modes confined between the two points is $\omega_n= n \pi c /a$. This sum is in principle infinite, but Casimir considers that if the confining points are metallic, modes with a frequency larger than a characteristic frequency cannot be confined~\cite{Casimir}. This is the plasma frequency (this will be more clear and physical in $3D$). The sum is actually finite, limited to a characteristic frequency $\omega_p$.

Therefore this maximal frequency $\omega_p$ drives the ``infinite'' sum, exactly as the Fermi energy controls the infinite sum of Landau levels in~\eqref{energy1}. And the frequency of the lowest mode, $\pi c / a$ plays the role of the cyclotron frequency. We have the analogy:
\begin{equation}
\begin{aligned}
\ep_F &\longleftrightarrow \hbar \omega_p, \\
\omega_c &\longleftrightarrow \frac{\pi c}{a}.
\end{aligned}
\end{equation}
We first assume that there is a sharp cut-off at frequency $\omega_p$, so that we write the sum as
\begin{equation} 
E(\omega_p)=\frac{\hbar \pi c}{2 a} \sum_{n=0}^\infty n \, \Theta(\omega_p - n \pi c /a). 
\end{equation} 
This sum on integers has been calculated in~\eqref{n-theta}. With the physical parameters of this problem, the Poisson summation gives:
\begin{equation} 
E(\omega_p)=\frac{\hbar a}{4 \pi c} \omega_p^2 - \frac{\pi \hbar c}{24 a}+ \osc\parens[\Bigg]{\frac{\omega_p a}{\pi c}}. 
\end{equation} 
In this form, the analogy with the Landau calculation is clear. Here the sum is over integers, giving $-1/12$, while for Landau it was over odd numbers, giving $1/12$. As we discuss in more details in the next subsection, the first term is the vacuum energy, the second term leads to the Casimir force
\begin{equation} 
F=-\frac{\partial E}{\partial a}= -\frac{\pi \hbar c}{24 a^2}
\end{equation} 
which is the equivalent of~\eqref{Landauchi} for the Landau susceptibility.\footnote{The Landau diamagnetic energy is a quadratic function of $\omega_c$ while the Casimir force is a linear function of $\pi c/a$. The difference comes from the Landau degeneracy which gives a multiplicative power of $\omega_c$.}

\subsection{Casimir force in 3D}

After this exercise, we come now to the original paper of Casimir~\cite{Casimir,Duplantier} who considers two large plates of size $L$ at short distance $a$ ($L \gg a$), see Figure~\ref{fig:Casimir1}. The total energy at $T=0$ is now
\begin{equation} 
E=\frac{\hbar}{2} \sum_{n,k_x,k_y} \omega_n(k_x,k_y) 
\end{equation} 
where the frequency of the $3D$ modes is now \smash{$\omega_n(k_x,k_y)= c \sqrt{\frac{n^2 \pi^2}{a^2} +k_x^2+k_y^2}$}. Following Casimir, we notice that this sum must have an upper cut-off since modes with frequency larger than the plasma frequency $\omega_p$ are not confined between the plates. Since $L$ is large, the transverse modes form a continuum and their sum can be replaced by an integral:
\begin{equation}\label{integral-transverse} 
E(\omega_p)=\frac{L^2 \hbar c}{2 \pi} \sum_{(n)} \int_0^{k_p} \sqrt{\frac{n^2 \pi^2}{a^2} +k^2} \, k \dd k 
\end{equation} 
where the upper limit $k_p(n)$ on the transverse vector $k$ is such that \smash{$\frac{n^2 \pi^2}{a^2}+ k_p^2 < \frac{\omega_p^2}{c^2}$}. We have inserted a factor $2$ to account for the modes degeneracy. The discrete sum $(n)$ means that the lowest mode has to be counted only once, so it will be affected by a factor $1/2$. Integration over transverse momenta gives
\begin{equation}\label{sum-casimir}
E(\omega_p)=\frac{L^2 \hbar c}{6 \pi} \sum_{(n)} \parens[\Bigg]{\frac{\omega_p^3}{c^3} - \frac{n^3 \pi^3}{a^3}} \Theta\parens[\Bigg]{\frac{\omega_p a}{\pi c} - n} 
\end{equation}
which we rewrite in a dimensionless form:
\begin{equation} 
E(\omega_p)=\frac{L^2 \pi^2 \hbar c}{6 a^3}\parens[\Bigg]{\sum_{n=1} (x^3 - n^3) \Theta(x-n)+x^3/2} 
\end{equation} 
with $x= \frac{\omega_p a}{\pi c} $. The last term is the lowest mode contribution. The sum is given in Appendix~\ref{app.Poisson}. It is written in term of the sums discussed in the previous sections. It involves the infinite sum over cubes of integers calculated in~\eqref{F3}:\footnote{\label{fnminus}
Notice that the sum over cubes is preceded by a $(-1)$ factor.}
\begin{equation} 
E(\omega_p)=\frac{L^2 \pi^3 \hbar c}{6 \pi a^3}\parens[\big]{x^3 S_0(x) - S_3(x)+x^3/2} 
\end{equation} 
where $S_0(x)$ and $S_3(x)$ are given by~\eqref{S0x}, \eqref{F3}, see also~\eqref{x3y3}. The term in parenthesis is
\begin{equation} 
\frac{3}{4} x^4 -\frac{1}{120}+ \osc(x) 
\end{equation} 
and the total energy is written as
\begin{equation} 
E(\omega_p)=L^2 a \frac{\hbar \omega_p^4}{8 \pi^2 c^3} - L^2\frac{\pi^2 \hbar c}{720 a^3} + \osc\parens[\Bigg]{\frac{\omega_p a}{\pi c}}. 
\end{equation} 
The first term is the vacuum energy. It is extensive (i.e.\ proportional to $L^2 a$ and the energy den\-si\-ty~is
\begin{equation} 
E_0(\omega_p)= \frac{\hbar \, \omega_p^4}{8 \pi^2 c^3}.
\end{equation} 
The nature of this vacuum energy is subtle and will not be discussed here. However since this energy density exists also outside the plates, it does not contribute to any force on the plates.\footnote{This term is often not considered and not discussed in the literature, including the Casimir paper.} The second term scales with the aera of the plates. It is at the origin of the (negative) Casimir pressure which represents the attractive force between the two plates:\footnote{It is interesting to point out that the calculation of the Casimir force involves the zeta function $\zeta(-1)$ in 1D and $\zeta(-3)$ in $3D$. They have opposite signs, while the force is attractive in both cases. This is because the integral~\eqref{integral-transverse} over transverse modes induces a change in sign on the sum over cubes~\eqref{sum-casimir}, see footnote~\ref{fnminus}.}
\begin{equation} 
P= -\frac{1}{L^2} \frac{\partial E}{\partial a}= - \frac{\pi^2}{720} \frac{\hbar c}{a^4}.
\end{equation}
Just as the Landau diamagnetism is the physical quantity which reveals the infinite sum over integer numbers, the Casimir pressure is the physical quantity which reveals the sum over cubes.

\begin{figure}[h!]
\includegraphics[width=4cm]{casimir-plaques.jpg}
\caption{Geometry of the Casimir effect. Two metallic plates at short distances are attracted by a small force.} \label{fig:Casimir1}
\end{figure}

\section{Conclusion}\label{sect.conclusion}

We have proposed an intuitive method to give a simple meaning to apparently strange terms which can be extracted from infinite non convergent sums, like the $-1/12$ for the infinite sum of naturals.

Based on the calculation of quantum oscillations and the diamagnetic response in a free electron gas in a magnetic field, we propose the simple scheme: replace the sum by a step function which takes its value at each number of the sum; Fourier transform this function to get (1) a principal term which tells how the sum scales to infinity, (2) oscillations which cancel in average and can be suppressed by appropriate smoothing of the step function, (3) a constant terms which remains when the oscillations have been suppressed. The latter term is precisely the Ramanujan sum.

The two physical examples in which the Ramanujan sum is revealed by a physical quantity are interesting because both the scaling at infinity and the Ramanujan term have a physical meaning. The first term is a ``vacuum energy''. This is obvious in the Casimir example, because it results from the summation of the zero point energies of the harmonic oscillators which are the modes of the electromagnetic field. Its signification is complex and will not be discussed here, but dimensional analysis shows that it scales like the $4^{\mathrm{th}}$ power of some frequency (or energy) scale.

In the Landau problem, the first term can also be considered as a ``vacuum energy'' since it is the total energy of a filled Fermi sea, which can be considered as the vacuum of electron-hole excitations. In three dimensions, it scales like the $2^{\mathrm{nd}}$ power of the Fermi energy. We can summarize these two physical points in the synthetic form:
\begin{align*}
1+3+5+7+ \dotsb + x \ \longrightarrow \ {\frac{x^2}{2}}&+{\frac{1}{12}}+ \osc(x), \\
\text{vacuum} &+ \text{Landau} \\
1+2^3+3^3+ \dotsb + x \ \longrightarrow \ {\frac{x^4}{4}}&+{\frac{1}{120}}+ \osc(x). \\
\text{vacuum} &+ \text{Casimir}
\end{align*}

\appendix

\section{Strange manipulations of infinite sums}\label{app.Ramanujan}

We recall here the Ramanujan calculations, taken from Wikipedia~\cite{Ramanujan_wiki}. Let $A$, $B$ and $S$ be three dis\-tinct sums, with $S$ being the sum of natural numbers, such that:
\begin{alignat*}{2}
	& A = 1-1+1-1+1- \dotsb \qquad &&\text{(Grandi series)}
\\	& B = 1-2+3-4+5- \dotsb \qquad &&\text{(alternate sum)}
\\	& S = 1+2+3+4+5+ \dotsb \qquad &&\text{(natural numbers)}
\end{alignat*}
\begin{description}%[leftmargin=*]
\item[Determination of $A$]\mbox{}\\*
One defines:
\[
A = 1-1+1-1+1- \dotsb
\]
We notice that, by reorganisation of the terms of the sum:
\[
\begin{split}
A
	& = 1-1+1-1+1-1+ \dotsb
\\	& = 1-(1-1+1-1+ \dotsb)
\\	& = 1-A.
\end{split}
\]
Therefore
\[
A={\frac{1}{2}} !!.
\]
\item[Determination of $B$]\mbox{}\\*
Let's start with
\[
B = 1-2+3-4+5-6+7-\dots
\]
We note that by taking the term-by-term difference, we have:
\[
\begin{aligned}
B-A
	& =	& 1&-2&+3&-4&+5&-6&\dots&
\\	&	& -1&+1&-1&+1&-1&+1&\dots&
\\	& =	& 0	&-1&+2&-3&+4&-5&\dots&
\\	& =	& -B.
\end{aligned}
\]
Thus:
\[
2B=A \ \implies \ B= {\frac {1}{4}} !!.
\]
\item[Determination of $S$]
\[
S=1+2+3+4+5+ \dotsb
\]
We note that by taking the term-by-term difference, we have:
\[
\begin{aligned}
S-B
	& = & 1&+2&+3&+4&+5&+6&\dots&
\\	&	& -1&+2&-3&+4&-5&+6&\dots&
\\	& =	& 0&+4&+0&+8&+0&+12&\dots&
\\	& = & 4S.
\end{aligned}
\]
Thus:
\[
S-4S=B \ \implies \ -3S=B \ \implies \ S=-{\frac {1}{12}} !!.
\]
\end{description}

\section{Poisson summation formula}\label{app.Poisson}

Consider the series of the form:
\begin{equation}
S_p(x)= \sum_{n=1}^\infty n^p \ \Theta(x -n)
\end{equation}
with $x>0$. The Poisson summation formula
\begin{equation} 
\sum_{n=0}^\infty f(n)= \frac{1}{2} f(0) + \int_0^\infty f(y) \,\dd y + 2\sum_{m=1}^\infty \int_0^\infty f(y) \cos(2 \pi m y) \,\dd y 
\end{equation} 
gives, with the notation $\omega=2\pi m$:
\begin{align}
	& S_0(x)= {x}{- \frac{1}{2}} + \sum_{m>0} \frac{1}{\pi m} \sin \rr x ={x}{-\frac{1}{2}} + \osc(x), \label{S0P}
\\	& S_1(x)= {\frac{x^2}{2}} + 2 \sum_{m=1}^\infty \bracks[\Bigg]{\frac{\cos \rr x {- 1}}{\rr^2}+ \frac{x \sin \rr x}{\rr}} = {\frac{x^2}{2}} {- \frac{1}{12}} + \osc(x), \label{S1P}
\\	& S_2(x)= {\frac{x^3}{3}} + 2 \sum_{m=1}^\infty \bracks[\Bigg]{\frac{2 \rr x \cos \rr x + (\rr^2 x^2 -2) \sin \rr x}{\rr^3}}={\frac{x^3}{3}} + \osc(x), \label{S2P}
\\	& S_3(x)= {\frac{x^4}{4}} + 2 \sum_{m=1}^\infty \bracks[\Bigg]{\frac{{6}+ 3 (\rr^2 x^2-2) \cos \rr x + \rr x(\rr^2 x^2 -6) \sin \rr x}{\rr^4}} ={\frac{x^4}{4}} {+\frac{1}{120}} + \osc(x). \label{S3P}
\end{align} 
Another useful formula:
\begin{equation}\label{x3y3}
\int_0^x (x^3-y^3) \cos \rr y \,\dd y = \frac{{-6} + (6- 3 \rr^2 x^2) \cos \rr x + 6 \rr x\sin \rr x}{\rr^4}. 
\end{equation}
More generally the Poisson summation formula leads to (we use complex notation and $\Re$ is the real part)
\begin{equation}
S_p(x)=\frac{x^{p+1}}{p+1} + 2 \, \Re \sum_{m=1}^\infty \frac{\bracks[\big]{\Gamma(p+1)-\Gamma(p+1, - 2 i m \pi x)}}{(- 2 i m \pi)^{p+1}}
\end{equation} 
where $\Re$ is the real part. The last term, $x$ dependent, contains the oscillations, that we do not consider here. It remains, after extraction of the real part:
\[
\begin{split}
 S_p(x) &= \frac{x^{p+1}}{p+1} + \frac{2 \Gamma(p+1)}{(2 \pi)^{p+1}} \cos \frac{(p+1) \pi}{2} \sum_1^\infty \frac{1}{m^{p+1}} \\ &= \frac{x^{p+1}}{p+1} + \frac{2 \Gamma(p+1)}{(2 \pi)^{p+1}} \cos \frac{(p+1) \pi}{2}\zeta(p+1).
\end{split}
\]
Using the Riemann functional relation,
\[
\frac{2}{(2 \pi)^s} \Gamma[s]\cos\frac{s \pi}{2} \zeta(s)=\zeta(1-s),
\]
we finally get:
\begin{equation} 
S_p(x)={\frac{x^{p+1}}{p+1}} + {\zeta(-p)}
\end{equation} 
as found in~\eqref{Spx}. The sum of even powers being zero corresponds to the trivial zeros of the zeta function.

\section{Damping of the oscillations}\label{app.damping}

Consider the sum ($\hbar = 1$)
\begin{equation}\label{Sdee0}
S(\ep_F)= \sum_{n= 0}^\infty n^p \, \Theta(\ep_F - n \omega_c).
\end{equation} 
It has two energy scales, $\ep_F$ which drives the infinity, and $\omega_c$ which extracts the Ramanujan sum. We now consider a smooth cut-off. We replace the Heaviside function by a smooth function $\chi_\beta (\ep_F - n \omega_c)$, which varies rapidly on a scale $1/\beta$ much smaller than $\ep_F$. Under this hypothesis, we can replace the new sum
\begin{equation} 
S_\beta(\ep_F)= \sum_{n=0}^\infty n^p \, \chi_\beta(\ep_F - n \omega_c) 
\end{equation} 
by
\begin{equation} 
S_\beta(\ep_F)= \sum_{n = 0}^\infty n^p \int \Theta(\ep - n \omega_c) \chi'_\beta(\ep_F - \ep) \,\dd \ep 
\end{equation} 
where $\chi'$ is the derivative with respect to $\ep$. This is done with an integration by parts. The interest of this transformation is to write the new sum in the form
\begin{equation} 
S_\beta(\ep_F)= \int S(\ep) \chi'_\beta(\ep_F - \ep) \,\dd \ep 
\end{equation} 
where $S(\ep)$ is given by~\eqref{Sdee0}. After the Poisson transformation of $S(\ep)$, we get terms of the form
\begin{equation} 
\int \cos 2 \pi m \frac{\ep}{\omega_c} \, \chi'_\beta(\ep_F - \ep) \,\dd \ep 
\end{equation} 
which may be written in the form
\begin{equation} 
R(Z) \, \cos 2 \pi m \frac{\ep_F}{\omega_c} 
\end{equation} 
where $R(Z)$ is a reduction factor ($Z$ is to be explicited below),
\begin{equation} 
R = \int \cos 2 \pi m \frac{\delta \ep}{\omega_c} \chi_\beta'(\delta \ep) \,\dd \ep.
\end{equation} 
We have introduced the difference $\delta\ep=\ep_F - \ep$.

Consider first the Fermi--Dirac function as first example of a smooth function
\begin{equation}\label{chibeta}
\chi_\beta(\delta \ep)= \frac{1}{e^{\beta \delta \ep}+1} 
\end{equation} 
and its derivative is a peaked function around the Fermi energy:
\begin{equation} 
\chi'_\beta(\delta \ep)=\frac{\beta}{4 \cosh^2\beta \delta\ep/2}.
\end{equation} 
The reduction factor is therefore given by
\begin{equation} 
R(Z)=\int_{-\infty}^{\infty} \frac{\cos z Z}{4 \cosh^2 z/2} \,\dd z 
\end{equation} 
that is
\begin{equation} 
R(Z)= \frac{\pi Z}{\sinh(\pi Z)}
\end{equation} 
where $Z= {2 \pi m / \beta \omega_c}$.

Consider impurity scattering. The smoothed Fermi--Dirac function is now given by~\cite{Shoenberg}
\begin{equation}\label{chitau}
\chi_\tau(\ep_F - \ep)=\frac{1}{2} + \frac{1}{\pi} \arctan \frac{(\ep_F - \ep)
}{1/ (2 \tau)} 
\end{equation} 
where $\tau$ is the scattering time. Its derivative is peaked around the Fermi energy:
\begin{equation} 
\chi_\tau'(\delta\ep)= \frac{1/(2 \pi \tau)}{\delta\ep^2 + (1/2 \tau)^2} 
\end{equation} 
and the reduction factor is
\begin{equation} 
R(Z)= \frac{1}{2 \pi} \int_{-\infty}^{\infty} \frac{\cos Z z}{z^2+1/4} \,\dd z 
\end{equation} 
so that
\begin{equation} 
R(Z)= e^{- Z/2}
\end{equation}
with $Z= 2 m \pi /\omega_c \tau$.

We see that the effect of a smooth cut-off with $1/\beta \ll x$ is to kill the oscillations but does not modify the infinite and the Ramanujan sum. In dimensionless units the function $\Theta(x-n)$ has to be replaced by a smooth function which varies on a scale larger much smaller than $x$.

\section{Some precaution about the cut-off}\label{app.cut-off}

\begin{figure}[h!]
\begin{subfigure}{6.9cm}
\centering
\includegraphics[width=\textwidth]{cut-off.jpg}
\caption{}
\end{subfigure}
\hfill
\begin{subfigure}{6.9cm}
\centering
\includegraphics[width=\textwidth]{cut-off-escalier.jpg}
\caption{}
\end{subfigure}
\caption{(a) Different cut-off functions: $\Theta(x-n)$ (red), $\chi_\beta(x-n)$ (blue), $\chi_\tau(x-n)$ (purple), $e^{-n/x}$ (black). Here we have taken $n=1$, $\beta=\tau=10$. (b) Sum of integers with the corresponding cut-off function. Obviously the exponential cut-off is not appropriate.}\label{fig:cut-off}
\end{figure}

A popular and simple smooth function (regularisation) is sometimes proposed. Instead of the smoothed step-like function that we have introduced with an appropriate $\beta$ to suppress the oscillations, an alternative and simple form is simply an exponential $e^{- n /x}$ (Figure~\ref{fig:cut-off}). It is convenient since the infinite sum can be easily calculated
\begin{equation} 
\sum_{n=1}^\infty n e^{-n/x}=\frac{1}{4 \sinh^2 (1/2x)}. 
\end{equation} 
In the limit $x \rightarrow \infty$, the sum varies as
\begin{equation} 
{x^2} -\frac{1}{12}
\end{equation} 
which is a cheap and easy way to recover the $-1/12$.

However, if one is interested on how the sum goes to infinity, the dominant term, the correct result, must go to infinity as $x^2/2$ and \emph{not} $x^2$. Here the first term is meaningless since it does not tell us correctly how the sum goes to infinity. This is clearly shown in Figure~\ref{fig:cut-off}. This is even worse when the power of the naturals increases:
\begin{itemize}
\item compare
\begin{equation} 
\sum_{n=0}^\infty n^3 \chi_\beta(x - n) \ \longrightarrow \ {\frac{x^4}{4}} +{\frac{1}{120}} \qquad \text{with} \qquad
\sum_{n=0}^\infty n^3 e^{-n/x} \ \longrightarrow \ 6 x^4 +{\frac{1}{120}};
\end{equation} 
\item compare
\begin{equation}
\sum_{n=0}^\infty n^p \chi_\beta(x - n) \ \longrightarrow \ {\frac{x^{p+1}}{p+1}}+ {\zeta(-p)} \qquad \text{with} \qquad \sum_{n=0}^\infty n^p e^{-n/x} \ \longrightarrow \ p! \, x^{p+1} +{\zeta(-p)}.
\end{equation}
\end{itemize}

\section*{Acknowledgments}

The author thanks J.-N.~Fuchs and F.~Piéchon for useful comments.

\section*{Declaration of interests}

The author does not work for, advise, own shares in, or receive funds from any organization that could benefit from this article, and has declared no affiliations other than their research organizations.

\printbibliography

\end{document}