Given some positive integer $m$ I'm looking for all solutions $\alpha,k>0$ to $2m+1=2\alpha k+\alpha^2$ with $0<k^2<2m.$ Right now I'm finding these by looping over each of these possible $k$ values and testing if the resulting quadratic has a solution, but I feel that something more clever would be faster. Any ideas?
You can assume that $m$ is large, e.g. $m>10^6,$ if it helps.
you can solve the quadratic equation in α. For integer solutions, we must have k^2 + 2m +1 = a perfect square. You then have a solution when k=m since then k^2 + 2k + 1 = (k+1)^2.