Given $D$, find $K$ such that $(D+1) + DK$ and $K+1$ are perfect squares

76 Views Asked by At

That's the problem I am facing:

Given $D>0$, find the minimum (or all) $K$ ($K>0$) such that both $(D+1) + DK$ and $K+1$ are perfect squares

How can I attack this problem?

1

There are 1 best solutions below

0
On BEST ANSWER

Write $d+1+dk=y^2$ and $k+1=x^2$. Then $y^2-d(k+1)=1$, i.e., $$ y^2-dx^2=1 $$ This is Pell's equation, and there are algorithms to find the solutions.