Finding a number $n$ and $k$ such that $nx+k$ will be a perfect square for any two given $x$.

108 Views Asked by At

Given two positive integers $x_1,x_2$, is it always possible to find positive integers $n$ and $k$ such that the expression $nx_i+k$ becomes a perfect square for each $i$ ?

3

There are 3 best solutions below

4
On

Suppose $x_1,x_2$ are the given (different) values of $x,$ then choose $$n=(x_1-x_2)(y^2-z^2)$$ and $$k=(x_1-x_2)(x_1z^2-x_2y^2)$$ for any appropriately choose $y,z\in\mathbb{N}.$

0
On

Yes. The idea is that $$(m + 1)^2 - (m - 1)^2 = 4m$$ which means that a multiple of $4$ can always be expressed as the difference of two squares. This means that if we let $n = 4m$ and $k$ be such that $$nx_1 + k = (m(x_2-x_1)-1)^2$$ then it will follow that $$nx_2 + k = (m(x_2-x_1)+1)^2$$ Thus pick $k = (m(x_2-x_1)-1)^2 - nx_1$. For positive $m$ we will have that $n$ is a positive integer, so we only need to be careful that $k$ is also positive. We need \begin{align} (m(x_2-x_1)-1)^2 - 4mx_1 &> 0\\ m^2(x_2-x_1)^2 - 2m(x_2+x_1) + 1 &> 0 \end{align} We can always find some positive $m$ to satisfy this.

0
On

Another method is this:

If we have $nx_1 + k = y_1 ^2$ and $nx_2 + k = y_2 ^2$ as given, and assuming WLOG $x_2 > x_1$, then:

$$y_2^2 - y_1^2 = n(x_2 - x_1)$$ $$(y_2 + y_1)(y_2 - y_1) = n(x_2 - x_1)$$

If we let $(y_2 - y_1) = (x_2 - x_1)$, then $y_2 + y_1 = n$. Putting this back in, we get:

$$(y_2 + y_1)x_1 + k = y_1^2$$ $$(y_2 + y_1)x_2 + k = y_2^2$$

Adding them: $$(y_2 + y_1)(x_2 + x_1) + 2k = y_2^2 + y_1^2$$ $$k = \frac{y_2^2 + y_1^2 - (y_2 + y_1)(x_2 + x_1)}{2}$$

Since $x_1, x_2$ differ by the same amount as $y_1, y_2$, we know $k$ is an integer.

To ensure k is positive: $$y_2^2 + y_1^2 - (y_2 + y_1)(x_2 + x_1) > 0$$ $$y_2^2 + y_1^2 > (y_2 + y_1)(x_2 + x_1)$$ $$(y_1 + x_2 - x_1)^2 + y_1^2 > (y_2 + y_1)(x_2 + x_1)$$ $$(y_1^2 + x_2^2 + x_1^2 + 2y_1x_1 - 2y_1x_2 - 2x_1x_2) + y_1^2 > ((y_1 + x_2 - x_1) + y_1)(x_2 + x_1)$$ $$(y_1^2 + x_2^2 + x_1^2 + 2y_1x_1 - 2y_1x_2 - 2x_1x_2) + y_1^2 > (2y_1 + (x_2 - x_1))(x_2 + x_1)$$ $$2y_1^2 +x_2^2 + x_1^2 + 2y_1x_1 -2y_1x_2 - 2x_1x_2 > 2y_1x_1 + 2y_1x_2 + x_2^2 - x_1^2$$ $$2y_1^2 + 2x_1^2 -4y_1x_2 - 2x_1x_2 > 0$$ $$(y_1 - x_1)^2 > x_1x_2$$ $$y_1 > \sqrt{x_1x_2} + x_1$$

To conclude, if you pick an $x_1, x_2$ and $y_1$ above a point computed from the first two, you can find a $y_2, n$, and $k$ that satisfy the question. Not only does a pair $(n,k)$ exist, but there are infinitely many solutions for a given $(x_1, x_2)$

This overlaps some with the answer from @Ross Pure, but it also provides solutions not possible from that method. ex: If you pick $x_1 = 1, x_2 = 3, m = 3$, then his method returns $n = 12$ and $k = 13$. The method provided here, if you choose $y_1 = 5$, returns the same. But you could have also chosen $y_1 = 4$, and gotten $n = 10, k = 6$, a solution not found the other way because 4 doesn't divide 10.