Finding elliptic curves with high ranks has been the focus of much research. Recently, with the goal of generating elliptic curves with a large rank, some authors used large integers n which have many divisors, amongst which one can find divisors d such that \(d+n/d\) is a perfect square. This strategy is in itself a motivation for studying the function \(\tau _\Box (n)\) which counts the number of divisors d of an integer n for which \(d+n/d\) is a perfect square. We show that \(\sum _{n\le x} \tau _\Box (n) = c_\Box x^{3/4} +O(\sqrt{x})\) for some explicit constant \(c_\Box \) . Moreover, letting \(\rho _1(n):=\max \{d\mid n: d\le \sqrt{n}\}\) and \(\rho _2(n):=\min \{d\mid n: d\ge \sqrt{n}\}\) stand for the middle divisors of n, we show that the order of magnitude of the number of positive integers \(n\le x\) for which \(\rho _1(n)+\rho _2(n)\) is a perfect square is \(x^{3/4}/\log x\) .