For a positive integer $n\geq 2$ with divisors $1=d_1
IMO 2002 P4
Let $n\geq 2$ be a positive integer with divisors $1=d_1<d_2<\cdots<d_k=n$.
Prove that $d_1d_2+d_2d_3+\cdots+d_{k-1}d_k$ is always less than $n^2$, and determine when it is a divisor of $n^2$
I am trying this question but I run out of ideas, could someone give a little hint or a suggestion? Please, without giving me the solution.
I am trying to use the fact that the product of $d_i$*$d_{i+1}$ is a divisor of $n^2$ (and they are all different) and maybe try to use the formula for the sum of divisors to see if this specific sum is less than $n^2$
 A: Hint 1: How large can $d_{k-1}$ be as a function of $n$?  What about $d_{k-2}$?
Hint 2: Let $p$ be the smallest prime factor of $n$.  What can you say about $d_{k-1}$ in terms of $n,p$?  What’s the largest (proper) divisor of $n^2$?
A: Since $d$ is a divisor of $n$ if and only if $n/d$ is, we have $$d_1d_2+d_2d_3+\cdots+d_{k-1}d_k=\left(\frac{n^2}{d_1d_2}+\frac{n^2}{d_2d_3}+\cdots+\frac{n^2}{d_{k-1}d_k}\right)\leq n^2\sum_{j=1}^{k-1}\left(\frac{1}{d_j}-\frac{1}{d_{j+1}}\right)<\frac{n^2}{d_1}=n^2$$ $$\tag*{$\left[\text{since $\frac{1}{d_jd_{j+1}}\leq\left(\frac{d_{j+1}-d_j}{d_jd_{j+1}}\right)=\left(\frac{1}{d_j}-\frac{1}{d_{j+1}}\right)$}\right]$}$$
For the second part, let $n$ be composite and $p$ be the smallest prime factor of $n$. Then we have $$d_1d_2+d_2d_3+\cdots+d_{k-1}d_k>d_{k-1}d_k=\frac{n^2}{p}$$ Now if $N=d_1d_2+d_2d_3+\cdots+d_{k-1}d_k$ is a divisor of $n$ then we must have $\frac{n^2}{N}\mid n^2$. But $p>\frac{n^2}{N}$ is a contradiction since $p$ is the smallest prime divisor of $n^2$. So $N\mid n^2$ if and only if $n$ is a prime.
