For a positive integer $n\geq 2$ 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<n^2$

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$?


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.