How would I find all integer solutions algebraically for $$x^2-2xy+n=0$$ if $n$ is known and a solution is known, but without factoring $n$. Also, is it possible to know how many integer solutions exist for this equation for a known $n$, again without factoring $n$.
-
$\begingroup$ cannot be done. From $n = x (2y-x),$ any solution gives factors, and the collection of all solutions gives a complete factoring of $n$ $\endgroup$ – Will Jagy Feb 6 '19 at 21:40
-
$\begingroup$ I see, but what about the number of solutions $\endgroup$ – James Feb 6 '19 at 21:41
-
$\begingroup$ If $n$ is odd, the number of solutions is the same as the number of divisors of $n$. If $n=2^km$, with $k\ge1$ and $m$ odd, then $x$ must have the form $2^hz$, where $0<h<k$ and $z\mid m$. In particular there is no solution if $k=1$. $\endgroup$ – egreg Feb 6 '19 at 22:45
-
$\begingroup$ So without factoring there's no way to know? $\endgroup$ – James Feb 6 '19 at 22:46
Above equation shown below:
$x^2-2xy+n=0$ ------$(A)$
Equation $(A)$ has solution:
$(x,y,n)=[(p),(p+2),(p^2+4p)]$
$$ 2 x y - x^2 = n $$ $$ x (2y - x) = n $$ $$ a * b = n $$ $$ 2 y - a = b $$ $$ y = (a + b) / 2 $$ $$ (x, y, n) = (a, (a + b) / 2, ab) $$ $$ n = -15 * (-1) = -5 * (-3) = ... = 3 * 5 = 5 * 3 = 15 * 1 $$ $$ 1) a = -15, b=-1; (x,y,n)=(-15, -8,15), $$ $$ ... $$ $$ n = 2 (2 m - 1) - no $$ $$ n = 6 = 2 * 3 - no $$
-
$\begingroup$ Is there any way to get answers without knowing $a$ or $b$ if a solution is known? $\endgroup$ – James Feb 7 '19 at 11:21