Perfect square given by ${r}^{2}+u\,r+v$, where r is variable and u,v are constants

114 Views Asked by At

I am looking for solution for a problem of finding a perfect square given by

$$ {r}^{2}+u\,r+v $$

where $u > 0$ and $v > 0$ are integer constants and expected $r >= 0$.

The closest I was able to get to is

$$ a^2 = r^2+u\,r+v $$ $$ \sum_{c=1}^{a}2\,c-1 = v+r\,u+\sum_{c=1}^{r}2\,c-1 $$ $$ (\sum_{c=r+1}^{a}2\,c-1)-r\,u-v = 0 $$

and I have no idea where to go from here, except for brute force search for an $r$ which would satisfy that ${r}^{2}+u\,r+v$ matches a perfect square test.

I am not sure whether there is a straightforward answer to this question, any suggestions welcomed!

1

There are 1 best solutions below

1
On BEST ANSWER

$$ (2a+2r+u)(2a-2r-u) = 4 v - u^2 $$ if $4v-u^2 = 0,$ there are infinitely many solutions. If $4v-u^2 \neq 0,$ it has a finite number of possible expressions as the product of two numbers, say $$ 4v-u^2 = PQ, $$ then solve $$ (2a+2r+u) = P, $$ and $$ (2a-2r-u) = Q. $$