A prime number $p > 2$ and $x,y \in \left\{ 1,2,\ldots, \frac{p-1}{2} \right\}$ are given. Prove that if $x\left( p-x\right)y\left( p-y\right)$ is a perfect square, then $x = y$.
Problem
Source: Polish MO
Tags: number theory, prime numbers
25.02.2017 23:09
Why always perfect square
26.02.2017 03:09
First, we prove the following lemma: Lemma. Let $m,n$ be positive integers so $\gcd (m,n)=1$, and let $S$ be the set of all positive integers of the form $mx^2+ny^2$ where $x,y$ are nonnegative integers. If $a \in S$ and $p \in S$ such that $p$ is prime and $p \mid a$, then $a/p$ can be written as $c^2+mnd^2$. Proof. Let $p=ma^2+nb^2, a=mx^2+ny^2$. We have $$(ma^2+nb^2)(c^2+mnd^2)=m(ac+nbd)^2+n(bc-mad)^2=m(ac-nbd)^2+n(bc+mad)^2.$$Note that $ma^2 \equiv -nb^2 \pmod{p}$ and $mx^2 \equiv -ny^2 \pmod{p}$ so $(max)^2 \equiv (nby)^2 \pmod{p}$ or $p \mid (max-nby)(max+nby)$. If $p \mid max+nby$ then from $p^2 \mid (ma^2+nb^2)(mx^2+ny^2)=(max+nby)^2+mn(bx-ay)^2$ we follow $p \mid bx-zy$. Let $x=ac+nbd, y=bc-mad$ we obtain $c= \frac{max+nby}{ma^2+nb^2}, d= \frac{bx-ay}{ma^2+nb^2}$, which are integers. Thus, $a/p= c^2+mnd^2$. If $p \mid max-nby$ then similarly, $c= \frac{max-nby}{ma^2+nb^2}, d= \frac{bx+ay}{ma^2+nb^2}$ are integers. Thus, $a/p$ can be written as $c^2+mnd^2$ for non-negative integers $c,d$. $\square$ Back to the problem. It suffices to prove that for each $1 \le x \le p-1$, if $x=a_1x_1^2, p-x=a_2x_2^2$ with $a_1,a_2$ are square-free positive integers ($(\gcd a_1,a_2)=1$ obviously) then there doesn't exist $y \ne x,p-x$ and $1 \le y \le p-1$ so that $y=b_1y_1^2,p-y=b_2y_2^2$ so $b_1b_2=a_1a_2$. Assume the contrary, there exists such $y$ then $$p=a_1x_1^2+a_2x_2^2=b_1y_1^2+b_2y_2^2, \; a_1a_2=b_1b_2.$$Since $\gcd (a_1,a_2)= \gcd (b_1,b_2)=1$ so we can let $a_1=xy,a_2=zt, b_1=xt,b_2=yz$ with $x,y,z,t$ are pairwise relatively prime. We will have $$p=xy \cdot x_1^2+zt \cdot x_2^2=xt \cdot y_1^2+yz \cdot y_2^2.$$Hence, $yt \cdot p= xt \cdot (yx_1)^2+ yz \cdot (tx_2)^2$ and $p=xt \cdot y_1^2+yz \cdot y_2^2$. From the lemma, we follows that $yt=c^2+ xyzt \cdot d^2$ with non-negative integers $c,d$. Hence, $d=0$ and $yt=c^2$. Since $xyzt=a_1a_2$ is a square-free integers so $yt$ is also square-free so $c=1$ or $y=t=1$. Similarly $z=x=1$. Thus, $a_1=a_2=b_1=b_2=1$ or $p=x_1^2+x_2^2=y_1^2+y_2^2$. Since a prime $p \equiv 1 \pmod{4}$ has unique representation of sum of two squares so either $x_1=y_1$ or $x_1=y_2$, i.e. either $x=y$ or $x=p-y$, a contradiction. From this, we follow that for each $1 \le x\le (p-1)/2$ so $x(p-x)=dk^2$ for $d$ a square-free numbers, there doesn't exist $y \ne x,1 \le y \le (p-1)/2$ so $y(p-y)=dl^2$. Thus, in order for $x(p-x)y(p-y)$ to be a perfect square then $x=y$.
07.03.2017 21:42
Let me write a beautiful solution by Jarosław Wróblewski. Write $xy=ka^2$ and $(p-x)(p-y)=kb^2$. Then $p$ divides $(p-x)(p-y)-xy=k(b-a)(b+a)$. Clearly $p \nmid k(b-a)$ so $p \mid a+b$. Now, if $x\neq y$ then $a^2\le ka^2=xy<\left(\frac{x+y}2\right)^2$. So $a<\frac{x+y}2$. Analogously $b<\frac{(p-x)+(p-y)}{2}$, thus $p\le a+b < \frac{x+y}{2} + \frac{(p-x)+(p-y)}{2} = p$, a contradiction. Therefore $x=y$.
07.03.2017 21:57
I'm sorry, but why is this true?? $p \nmid k(b-a)$
07.03.2017 22:26
Well, neither $x$ nor $y$ is divisible by $p$ so it follows from $xy=ka^2$ that $p\nmid k$. Also, it is clear that $p-x,p-y<p$, therefore $kb^2=(p-x)(p-y)<p^2$, so $b<p$, thus $b-a<p$, thus $p \nmid b-a$. (For this we have to observe that $b-a>0$ too.)
07.03.2017 22:37
Oh i totally forgot about the constraint on the values of x and y hahahhaha... thanks