You asked the question to write the following sum in the limit $n\to\infty$ as an integral,
$$
\lim_{n\to\infty}\frac{r-1}{n}\cdot\sum_{i=r}^n\frac{1}{i-1}.
$$
I understand that the lower summation bound $r=a n$ depends on $n$. The factor in front of the sum converges to $(r-1)/n \stackrel{n\to\infty}{\rightarrow}a$. The sum becomes
$$
\lim_{n\to\infty}\sum_{i=an}^n\frac{1}{i-1}
=\lim_{n\to\infty}\sum_{i=an}^{n-1}\frac{1}{i}
$$
in the limit. Let me write the sum under the limit on the right-hand side as a Riemann sum for the definite integral
$$
\int_{a/(1-a)^2}^{1/(1-a)^2} 1/t\,dt
$$
with $n(1-a)$ subdivisions of constant widths $(n(1-a)^2)^{-1}$. Note that the cumulative width of the subdivisions is $(1-a)^{-1}$ as it should be. We have
$$
\sum_{i=an}^{n-1}\frac{1}{i}
=\sum_{i=an}^{n-1}\frac{1}{n(1-a)^2}\cdot\frac{1}{\frac{i}{n(1-a)^2}}
=\sum_{i=0}^{n(1-a)-1}\frac{1}{n(1-a)^2}\cdot\frac{1}{\frac{i+na}{n(1-a)^2}}.
$$
I rewrite the right-hand side into
$$
\sum_{i=an}^{n-1}\frac{1}{i}
=\sum_{i=0}^{n(1-a)-1}\frac{1}{n(1-a)^2}\cdot\frac{1}{\frac{a}{(1-a)^2}+\frac{i}{n(1-a)^2}}.
$$
Using the number of subdivision $m:=n(1-a)$, we obtain
$$
\sum_{i=an}^{n-1}\frac{1}{i}
=\sum_{i=0}^{m-1}\frac{1}{m(1-a)}\cdot\frac{1}{\frac{a}{(1-a)^2}+\frac{i}{m(1-a)}},
$$
which converges to the integral suggested above,
$$
\lim_{m\to\infty}
\sum_{i=0}^{m-1}\frac{1}{m(1-a)}\cdot\frac{1}{\frac{a}{(1-a)^2}+\frac{i}{m(1-a)}}
=\int_{a/(1-a)^2}^{1/(1-a)^2} 1/t\,dt
= -\ln(a)\,.
$$
The full expression above then becomes
$$
\lim_{n\to\infty}\frac{r-1}{n}\cdot\sum_{i=r}^n\frac{1}{i-1}
=-a\ln(a)\,.
$$
It is now easy to check that $a=1/e$ maximizes this expression.