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](https://oeis.org).


**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).



Is $\sum_{n=1}^\infty\frac{S(n)}{n!}$ an irrational, where $S(n)$ denotes the sum of remainders function?
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.


