# If $\dfrac{4x^2-1}{4x^2-y^2}$ is an integer, then it is $1$

The problem is the following:

If $x$ and $y$ are integers such that $\dfrac{4x^2-1}{4x^2-y^2}=k$ is also an integer, does it implies that $k=1$?

This equation is equivalent to $ky^2+(1-k)4x^2=1$ or to $(k-1)4x^2-ky^2=-1$. The first equation is a pell equation (if $k$ is a perfect square) and the second is a pell type equation (if $k-1$ is a perfect square). I've tried setting several values of $k$ to get some solutions but i got nothing. I'm starting to think that $k$ must be $1$.

-

This is a fun problem! Where did you find it?

There are no solutions except for $k=1$. Assume from now on that $k \neq 1$. Since $k$ is clearly odd, it is also not $0$ and we deduce that $k(k-1)>0$. It is convenient to set $M = k(k-1)$. Also, we may assume WLOG that $x$ and $y\geq0$.

As you did, rewrite the equation to $$ky^2 - 4 (k-1) x^2 = 1$$ or $$(ky)^2 - k(k-1) (2x)^2 = k.$$ Set $Y=ky$ and $X=2x$ so the equation is $$Y^2 - M X^2 = k. \quad (\ast)$$

We will study the equation $(\ast)$. In the end, we will see that there are no solutions with $X$ even and $Y$ divisible by $k$.

The rest of this proof works inside the ring $R:=\mathbb{Z}[\sqrt{M}]$. Note that $M=k(k-1)$ is not square, so this is an integral domain. For an element $\alpha = a+b \sqrt{M} \in R$, set $\bar{\alpha} = a - b \sqrt{M}$.

Set $\epsilon = (2k-1) + 2 \sqrt{M}$. Note that $\epsilon \bar{\epsilon} = (2k-1)^2 - 4 k(k-1) = 1$, so $\epsilon$ is a unit of $R$.

Set $\delta = Y+X \sqrt{M}$. Since $\delta$ is a positive real, and $\epsilon>1$, there is some integer $n$ such that $\epsilon^n \leq \delta < \epsilon^{n+1}$. Write $\delta = \gamma \epsilon^n$. Since $\epsilon$ is a unit, $\gamma$ is in the ring $R$ and, by construction, $$1 \leq \gamma < \epsilon.$$ We have $$\epsilon = 2k-1 + 2 \sqrt{k(k-1)} < 2k+ 2k = 4k.$$ So $$1 \leq \gamma < 4k.$$

But, also $\gamma \bar{\gamma} = \delta \bar{\delta} =k$. So $$\frac{1}{4} \leq \bar{\gamma} \leq k.$$ Write $\gamma = U + V \sqrt{M}$. So $$\begin{matrix} 1 & \leq & U+V\sqrt{M} & < & 4k \\ \frac{1}{4} & \leq & U-V\sqrt{M} & < & k \\ \end{matrix}.$$ Solving for $V$, we have $$\frac{-k}{2 \sqrt{M}} < V < \frac{2k}{\sqrt{M}}.$$ The LHS is $\approx -1/2$, and the right hand side is slightly larger than $2$. So $V$ is $0$, $1$ or $2$. We break into cases:

$\bullet$ If $V=0$, then the equation $\gamma \bar{\gamma} =k$ gives $U^2 =k$. So $k$ is a square, say $k=m^2$ and $M=m^2(m^2-1)$. We have $$Y+X \sqrt{M} = m ((2k-1)+2 \sqrt{M})^n = m (2m^2-1 + 2 m \sqrt{m^2-1})^n.$$ An easy induction on $n$ shows that $Y \equiv (-1)^n m \mod m^2$ so, except when $m=1$, we do not have $Y$ divisible by $k=m^2$. Of course, the case $m=1$ corresponds to $k=1$.

$\bullet$ If $V=1$ then $U^2 - k(k-1) = k$ so $U=k$. We have $$Y+ X \sqrt{M} = (k+\sqrt{M}) \cdot ((2k-1)+2 \sqrt{M})^n.$$ An easy induction on $n$ shows that $X$ is odd.

$\bullet$ If $V=2$ then $U^2 - 4k(k-1) = k$ so $4k^2-3k = U^2$. This gives $64k^2 - 48 k + 9= 64 U^2+9$ or $(8k-3)^2 - (8U)^2 = 9$. The only ways to write $9$ as a difference of squares are $3^2-0^2$ and $5^2-4^2$. The former gives $k=0$, but we saw that $k$ must be odd; the latter gives no solution since $8$ does not divide $4$.

-

Well notice that both the numerator and denominator are squares, so we may factor

$$\frac{4x^2 - 1}{4x^2 - y^2} = \frac{(2x+1)(2x-1)}{(2x-y)(2x+y)}.$$

It is easy to see that $\gcd(2x + 1, 2x - 1) = 1$, so if $k$ is an integer, it must be the case that the denominator each divides one of the linear factors up top. Then there are only two cases for which this is possible: we must have either $y = 1$, or $2x-y = 1$ and $2x+y = (2x + 1)(2x - 1)$, since otherwise, the positive factor below will be larger than either of the numerator factors and thus cannot divide either of them.

Let's consider the case where $2x - y = 1$ and $2x + y = (2x + 1)(2x -1)$. From the first equation, we have $y = 2x + 1$, so

$$2x + y = 4x + 1 = 4x^2 - 1,$$

or

$$4x^2 - 4x - 2 = 0.$$

However, solving that for $x$ shows that $x$ is not an integer, so this case is impossible. Therefore, we are led to the conclusion that $k$ is also an integer when $y = 1$, and in that case, $k = 1$.

Edit: EuYu pointed out some details that I overlooked. Refer to the comments for the discussion.

-
Why must the denominator each divide one of the linear factors? – EuYu Oct 17 '12 at 4:15
Because we want the whole fraction to come out as a integer. That means the denominator cleanly divides the numerator. Now, since the linear factors in the numerator are relatively prime, it must be the case that either the denominator divides exactly one of the linear factors or that one of the denominator factors is 1 and the other liner factor divides all of the numerator. Maybe I made an error, though! Let me know if I am missing something! – Raymond Cheng Oct 17 '12 at 4:18
What exactly prevents a term in the denominator having prime factors from both terms in the numerator? It seems similar to concluding that if $(a,\ b)=1$ then $n\mid ab \implies n\mid a \lor n\mid b$. – EuYu Oct 17 '12 at 4:22
Ah, good catch. However, I am luckily saved by the specifications of the problem. If we don't have the denominator factors dividing the top, and instead, we have the case where the denominator simply contains the numerator's prime factors and others, then the denominator is larger than the numerator, and in particular, the fraction is non-integral. So in either case, the conclusion holds. Good catch though! – Raymond Cheng Oct 17 '12 at 4:27
I think you are missing my point. I'm not saying that the denominator has other prime factors. I'm asking why can't the prime factors of one of the terms in the numerator be distributed to both terms of the denominator? Your claim is that each term of the denominator must divide one of the terms in the numerator. – EuYu Oct 17 '12 at 4:32