Let $a_2=1$. For $n=3,4,\dots$, let $$ a_n=\min\left\{i=1,\dots,n:\frac{1}{i}\sum_{k=1}^{i}\frac{1}{k}\ge \frac{1}{n-1}+\sum_{j=i+1}^{n-1}\frac{1}{j(j-1)}\sum_{k=1}^{j}\frac{1}{k}\right\}, $$ where $\sum_{j=l}^{m}c_j:=0$ if $l>m$. Letting $f(n)=\frac{1}{n-1}+\sum_{j=i+1}^{n-1}\frac{1}{j(j-1)}\sum_{k=1}^{j}\frac{1}{k}$, it is not difficult to verify that $f(n)$ is strictly increasing in $n$, so $a_n$ is increasing in $n$.
I want to study the asymptotic order of $a_n$, and I tried to let $a_n/n\to a$ as $n\to\infty$. By the definition of $a_n$ and a Riemann approximation, we have $$ \frac{1}{a}\int_{0}^{a}\frac{dx}{x}=1+\int_{a}^{1}\frac{1}{x^2}\int_{0}^{x}\frac{1}{y}dydx, $$ which does not converge! I have no idea how to solve the equation for $a$. Please give me some hints. Thanks a lot!
$a_n=\min\left\{i=1,\dots,n:\frac{1}{i}\sum_{k=1}^{i}\frac{1}{k}\ge \frac{1}{n-1}+\sum_{j=i+1}^{n-1}\frac{1}{j(j-1)}\sum_{k=1}^{j}\frac{1}{k}\right\}, $
As a starter, $\frac{1}{i}\sum_{k=1}^{i}\frac{1}{k} \approx \dfrac{\ln(i)+\gamma}{i} $,
$\begin{array}\\ s(i, n) &=\sum_{j=i+1}^{n-1}\frac{1}{j(j-1)}\sum_{k=1}^{j}\frac{1}{k}\\ &=\sum_{k=1}^{n-1}\sum_{j=i+1}^{n-1}\frac{1}{j(j-1)}\frac{1}{k}\\ &=\sum_{k=1}^{n-1}\frac{1}{k}\sum_{j=i+1}^{n-1}\frac{1}{j(j-1)}\\ &=\sum_{k=1}^{n-1}\frac{1}{k}\sum_{j=i+1}^{n-1}(\frac1{j-1}-\frac1{j})\\ &=\sum_{k=1}^{n-1}\frac{1}{k}(\frac1{i}-\frac1{n-1})\\ &\approx(\frac1{i}-\frac1{n-1})(\ln(n)+\gamma)\\ \end{array} $