# Is $\sum_{n=1}^\infty\frac{S(n)}{n!}$ an irrational, where $S(n)$ denotes the sum of remainders function?

For each integer $$n\geq 1$$ we consider the arithmetic function $$S(n)=\sum_{k=1}^n n\text{ mod }k,\tag{1}$$ the sum of remainders function, the arithmetic function A004125 from the OEIS.

Example. We've that for $$n=6$$ $$S(6)=0+0+0+6\text{ mod }4+6\text{ mod }5+0=2+1=3.$$

This arithmetic function was studied for example in [1]. I wondered about a type of problems that are in the literature, that is in our case what about the irrationality of the real number $$\sum_{n=1}^\infty\frac{S(n)}{n!}.\tag{2}$$

I don't know if this previous example is in the literature or has good mathematical content.

Question. Is it possible to deduce that $$\sum_{n=1}^\infty\frac{S(n)}{n!}$$ is irrational? Or well, is it possible to discard it as an irrational?

I am asking about if it possible to do or provide some work, reasonings or heuristics, about it. Then I should to accept an answer. If it is in the literature refer the article and I try to search and read the statement and proof.

## References:

[1] Michael Z. Spivey, The Humble Sum of Remainders Function, Mathematics Magazine, Vol. 78, No. 4 (Oct., 2005).

• See also, John B. Friedlander, Florian Luca and Mihai Stoiciu, On the irrationality of a divisor function series, INTEGERS: Electronic Journal of Combinatorial Number Theory 7, article #A31, (2007). Sep 1, 2019 at 10:43
• I think that this MO site should appreciate and thank in some special way to professionals and serious mathematicians like you, and that are so generous as you offering your reputation in bounties. I would like to add my tribute dedicating you this post @AliTaghavi . Isn't required a response of this message, and good week. Sep 1, 2019 at 18:49
• Thank you very much for your very kind words Sep 1, 2019 at 19:37
• This would follow from the fact that there are infinitely many $n$ with $n\mid S(n)$. Indeed, in this case the sum would have the form (integer)$/(n-1)!+$(something smallet than $1/(n-1)!$). The condition $n\mid S(n)$ may be relaxed further --- i.e., to $S(n)\mod n<n/(2+\varepsilon)$... Sep 6, 2019 at 21:34
• Perhaps we could assume this number to be rational and figure out what its period may be. Nov 19, 2019 at 20:29

Well, let me elaborate Ilya Bogdanov's argument. First of all, $$S(n)=\sum_{k=1}^n \left(n-k\lfloor n/k\rfloor\right)=n^2-\sum_{k,d:kd\leqslant n} k= n^2-\sum_{d=1}^n (1+2+\ldots+\lfloor n/d\rfloor).$$ We have $$1+2+\ldots+\lfloor n/d\rfloor=\frac1{2d^2}n^2+O(n/d)$$, thus $$S(n)=\beta n^2+O\left(n\sum_{i=1}^n \frac1d+n^2\sum_{d=n+1}^\infty\frac1{2d^2}\right)=\beta n^2+O(n\log n),$$ where $$\beta=1-\frac12\sum_{d=1}^\infty \frac1{d^2}=\frac12-\frac{\pi^2}{12}$$. Assume that $$\alpha:=\sum_{k=1}^\infty \frac{S(k)}{k!}$$ is rational. Choose large $$n$$. Then $$(n-1)!\alpha=(n-1)!\sum_{k=1}^\infty \frac{S(k)}{k!}=\text{integer}+\frac{S(n)}n+\frac{S(n+1)}{n(n+1)}+o(1)=\\ \text{integer}+\frac{S(n)}n+\beta+o(1),$$ thus $$S(n)/n=k_n-\beta+o(1)$$ for certain integer $$k_n$$. We get $$k_{n+1}-\beta+o(1)=\frac{S(n+1)}{n+1}=\frac{S(n)+(2n+1)-\sigma(n+1)}{n+1}=\\ \frac{S(n)}{n+1}+\frac{(2n+1)-\sigma(n+1)}{n+1}= \frac{S(n)}n-\frac{S(n)}{n(n+1)}+\frac{(2n+1)-\sigma(n+1)}{n+1}=\\ k_n-\beta+o(1)-\beta+\frac{(2n+1)-\sigma(n+1)}{n+1}.$$ If, say, $$n+1$$ is large prime, this is not possible.

• Many thanks for your generous answer and share it in this site, thanks to you and your colleagues in previous answers. Tomorrow in the morning I am going to study it. Nov 19, 2019 at 21:23

This is just a reduction of the claim to an other (plausible) claim.

Notice that $$S(n)\leq 1+2+\dots+\lfloor n/2\rfloor+\lceil n/2\rceil+\dots+1=n^2/4+O(n)$$. This yields $$\sum_{k>n}\frac{S(k)}{k!}\leq \frac1{(n-1)!}\left(\frac12+o(1)\right).$$

Now, assume that $$S(n)\mod n<\frac{n}{2+\varepsilon} \qquad\text{for infinitely many n.}\qquad(*)$$ For such $$n$$ being large enough, denoting the sum under consideration by $$\alpha$$, we would have $$\alpha=\frac{A}{(n-1)!}+\frac{S(n)\mod n}{n!}+\sum_{k>n}\frac{S(k)}{k!} \in\left(\frac{A}{(n-1)!},\frac{A+1}{(n-1)!}\right)$$ for some integer $$A$$. Therefore, $$\alpha$$ is not a ratio of an integer with $$(n-1)!$$ (for infinitely many $$n$$), which means $$\alpha$$ is irrational.

Thus, in order to show the irrationality of $$\alpha$$, it sufices to prove $$(*)$$.

In particular, it would suffice to prove that there are infinitely many $$n$$ with $$n\mid S(n)$$...

Remark. In fact, $$\frac{S(n)}{n^2}\to \sum_{k=1}^\infty \frac1{2k(k+1)^2} \qquad\text{as n\to\infty.}$$ Does it help?

• It seems to help, if we accurately specify the remainder term. Say, take $n$ which is simultaneously divisible by $100!$ and such that $n\beta$ is almost integer, where $\beta=1-\pi^2/12$ is the limit value. Sep 6, 2019 at 22:42
• $S(n)=n^2-\sum_1^n\sigma(k)$ where $\sigma$ is the sum of divisors function. Surely someone has thought about whether $n$ divides $\sum_1^n\sigma(n)$ infinitely often. Sep 6, 2019 at 22:53
• @ThomasBrowning: I've obtained this formula as well. Do you have any idea of how to search those attempting this question? Sep 6, 2019 at 22:57
• Here's the OEIS sequence: A056550 Sep 6, 2019 at 23:09
• @IlyaBogdanov it looks infinite to me but I don't see how one would prove it Sep 6, 2019 at 23:10

Here's a partial answer (too long for a coment) that attempts to evaluate the sum $$\sum_{n=1}^\infty\frac{S(n)}{n!}$$ directly. Let $$\sigma(n)$$ denote the sum of divisors of $$n$$. First note that $$S(n)=S(n-1)+(n-1)-(\sigma(n)-n)$$ because each of the $$n-1$$ remainders increases by $$1$$ but there is overflow whenever $$k$$ is a proper divisor of $$n$$ (and the sum of such $$k$$'s is $$\sigma(n)-n$$). Since $$S(0)=0$$, this gives the formula $$S(n)=\sum_{k=1}^n((2k-1)-\sigma(k))=n^2-\sum_{k=1}^n\sigma(k)=n^2-\sum_{d=1}^nd\left\lfloor\frac{n}{d}\right\rfloor.$$ Then $$\sum_{n=1}^\infty\frac{S(n)}{n!}=\sum_{n=1}^\infty\frac{n^2}{n!}-\sum_{n=1}^\infty\sum_{d=1}^n\frac{d}{n!}\left\lfloor\frac{n}{d}\right\rfloor=2e-\sum_{d=1}^\infty\sum_{n=0}^\infty\frac{d}{n!}\left\lfloor\frac{n}{d}\right\rfloor.$$ If we let $$n\%d$$ be the remainder of $$n$$ when dividing by $$d$$, then $$\sum_{n=0}^\infty\frac{d}{n!}\left\lfloor\frac{n}{d}\right\rfloor=\sum_{n=0}^\infty\frac{n-(n\%d)}{n!}=e-\sum_{n=0}^\infty\frac{n\%d}{n!}.$$ In this last sum, the coefficients of $$\frac{1}{n!}$$ have period $$n$$. Then abstractly, this last sum should be a formal linear combination of the $$n$$ power series for $$e^\omega$$ as $$\omega$$ runs through the $$n$$th roots of unity. Indeed, $$\sum_{n=0}^\infty\frac{n\%d}{n!}=\frac{d-1}{2}e+\sum_{k=1}^{d-1}\frac{1}{\omega_d^{-k}-1}e^{\omega_d^k}$$ where $$\omega_d$$ is a primitive $$d$$th root of unity so $$\sum_{n=0}^\infty\frac{d}{n!}\left\lfloor\frac{n}{d}\right\rfloor=\frac{3-d}{2}e-\sum_{k=1}^{d-1}\frac{1}{\omega_d^{-k}-1}e^{\omega_d^k}.$$ Thus, \begin{align*} \sum_{n=1}^\infty\frac{S(n)}{n!}&=2e-\sum_{d=1}^\infty\left(\frac{3-d}{2}e-\sum_{k=1}^{d-1}\frac{1}{\omega_d^{-k}-1}e^{\omega_d^k}\right)\\ &=e-\sum_{d=2}^\infty\left(\frac{3-d}{2}e-\sum_{k=1}^{d-1}\frac{1}{\omega_d^{-k}-1}e^{\omega_d^k}\right)\\ \end{align*} The number-theoretic functions are all gone but unfortunately, this still looks rather intractable. Maybe someone can see a way to sum this?

• Many thanks for share your great calculations, I am going to study these. Sep 7, 2019 at 11:22