The numbers $p$ and $q$ are prime and satisfy \[\frac{p}{{p + 1}} + \frac{{q + 1}}{q} = \frac{{2n}}{{n + 2}}\] for some positive integer $n$. Find all possible values of $q-p$. Luxembourg (Pierre Haas)
Problem
Source: 2012 European Girls’ Mathematical Olympiad P5
Tags: number theory, modular arithmetic, equation, EGMO, primes, GCD
13.04.2012 16:35
Because $\frac{4}{{n + 2}} = \frac{1}{{p + 1}} - \frac{1}{q} = \frac{{q - p - 1}}{{q(p + 1)}}$,we have $q > p + 1 \geqslant 3$, and $4q(p + 1) = (n + 2)(q - p - 1)$. Because $q$ is a prime, $(q,q - p - 1) = (q,p + 1) = 1$, so $(q - p - 1)\left| 4 \right.$, hence $q - p - 1 = 1,2,4$, $q - p = 2,3,5$. And We can take $(p,q,n) = (3,5,78),(2,5,28),(2,7,19)$ for these $q - p$. Above all, the all possible values of $q - p$ are $2,3,5$.
13.04.2012 23:36
I am not sure if $(q,p+1)=1$ is true. What if $q = 7$ and $p = 13$ because then $(q,p+1)=7$.
13.04.2012 23:56
It is true, as $q>p+1$.
18.04.2012 14:13
p=13 and q = 7 is not valid choice because if you compute the L.H.S, the denominator of it will be 29 which is clearly not of the form 2n.
05.06.2012 08:17
yunxiu wrote: Because $\frac{4}{{n + 2}} = \frac{1}{{p + 1}} - \frac{1}{q} = \frac{{q - p - 1}}{{q(p + 1)}}$,we have $q > p + 1 \geqslant 3$, and $4q(p + 1) = (n + 2)(q - p - 1)$. Because $q$ is a prime, $(q,q - p - 1) = (q,p + 1) = 1$, so $(q - p - 1)\left| 4 \right.$, hence $q - p - 1 = 1,2,4$, $q - p = 2,3,5$. And We can take $(p,q,n) = (3,5,78),(2,5,28),(2,7,19)$ for these $q - p$. Above all, the all possible values of $q - p$ are $2,3,5$. Why $g.c.d.(q,p+1)=1$?, again there is given ,find the value of $(q-p)$, it may me negative.
05.06.2012 08:33
What is even the reason to quote some text, when you don't even bother to read it, MANMAID ? It is clearly stated and proved in the first line of what you quoted that $q>p+1$, so how could $q-p$ be negative ? As an aside, another weakness of this not-too-beautiful problem is that, to reach the few values possible, one does not even need the primality of $p$; just $q$ being a prime matters.
05.06.2012 12:30
This solution, I did without taking any restriction , and how much I full that I overcame that if $k<0$, then not necessary to take $p>q$, so I commented to yunxiu's post. Sorry for my wrong comment. Thanks to mavropnevma to point out it. The numbers p and q are prime and satisfy $\frac{p}{{p + 1}} + \frac{{q + 1}}{q} = \frac{{2n}}{{n + 2}}=\frac{2pq+p+q+1}{(p+1)q}$ Case 1: $q|(p+1)$ ,then $p+1=kq$, then $\frac{2pq+p+q+1}{(p+1)q}=\frac{2kq+k-1}{kq}$ . now, choose $(k-1)$ is even, choose $n$ is odd. Now $kq=(n+2)$ & $2kq+k-1=2n\Rightarrow{k=-3}$ ,which is impossible. Now take $n=2m$, then $kq=m+1$ & $2kq+k-1=2m\Rightarrow{k=-1}$ ,which is impossible. Case 2: $(p+1)|q$, then $p$ should be $2\Rightarrow{q=3}$,this gives $1=\frac{n}{n+2}$, which is impossible. Case 3: gcd$((2pq+p+q+1),(pq+q))=1$ ,then , Sub case 1: Take $p,q$ both odd, then $\frac{2n}{n+2}=\frac{2m}{m+1}=\frac{2m_1+1}{m_1+1}=1+\frac{m_1}{m_1+1}$ Now, $\frac{p}{{p + 1}} + \frac{{q + 1}}{q}=1+\frac{pq+p+1}{pq+q}$(Taking $q+1>p$), we get $pq+p+2=pq+q\Rightarrow{q-p=2}$ Subcase 2: $p=2$, then $\frac{5q+3}{3q}=\frac{{2n}}{{n + 2}}$ If $n$ is odd then we get $5q+3=2n$ & $3q=n+2\Rightarrow{q=7}$ i.e. ,$q-p=5$. If $n$ is even then we get $5q+3=2m$ & $3q=m+1\Rightarrow{q=5}$ i.e. ,$q-p=3$ Hence $(q-p)=2,3,5$
21.01.2015 06:13
yunxiu wrote: The numbers $p$ and $q$ are prime and satisfy \[\frac{p}{{p + 1}} + \frac{{q + 1}}{q} = \frac{{2n}}{{n + 2}}\] for some positive integer $n$. Find all possible values of $q-p$. Luxembourg (Pierre Haas) So my intuition was to split this into a tiny chunk to investigate. So we have that $\frac{p}{p+1}+1+\frac{1}{q} = 1 + \frac{n-2}{n+2}$ or $\frac{pq+p+1}{pq+q} = \frac{n-2}{n+2}$. This assumes that $\frac{pq+p+1]}{pq+q} < 1$ or $pq+q > pq+p+1 \implies q>p+1$. From here I split this problem into 3 cases, $n$ is odd, $n \equiv 2 \pmod{4}$, and $n \equiv 0 \pmod{4}$. Case 1: n is odd $\frac{pq+p+1}{(p+1)q} = \frac{n-2}{n+2}$. If $p=2$ then $\frac{2q+3}{3q} = \frac{n-2}{n+2}$. We have that $gcd(2q+3,3q) = gcd(2q+3,q-3) = gcd(2q+3-2q+6,q-3)=gcd(9,q-3)$. So if $gcd(9,q-3)=1$ then $3q-2q-3=4 \implies q = 7$. If $gcd(9,q-3)=3$ this implies $q \equiv 0 \pmod{3} \implies q=3$ which doesn't work since that would assume $3>2+1=3$. Finally, if $gcd(9,q-3)=9$ then $q-3 \equiv 0 \pmod{9}$ again assuming $q \equiv 0 \pmod{3}$ which again doesn't work. Thus if $p=2$ and $n$ is odd $q-p=7-2=5$ Now if $p$ is in fact odd then from $q>p+1$ and $q$ is prime we must have that $q$ is odd. We try to break this fraction into tinier pieces which leads us to $\frac{pq+p+1}{pq+q} = \frac{pq+p+1-pq-q}{pq+q}+1 = \frac{p-q+1}{pq+q}+1 = 1-\frac{4}{n+2}$ Thus $\frac{q-p-1}{pq+q} = \frac{4}{n+2}$. This would assume $(n+2)(q-p-1) = 4q(p+1)$. If $q \equiv 1 \pmod{4}$ then, since $n+2$ is odd, we must have $q-p-1 \equiv 0 \pmod{8}$. But we have that $ p \equiv q-1 \pmod{8}$ which will always be even which contradicts $p$ is odd. If $q \equiv 3 \pmod{4}$ then the same thing happens. Thus, the only solution for $q-p$ when $n$ is odd is $q-p=5$. Case 2: $n \equiv 2 \pmod{4}$. Then $n=4a+2$ for some $a$. We will use our already derived $\frac{q-p-1}{pq+q} = \frac{4}{n+2}$ for convenience. This would imply $\frac{q-p-1}{pq+q} = \frac{4}{4a} = \frac{1}{a}$ for some $a$. All this means is that $pq+q$ is a multiple of $q-p-1$ or $q-p-1|pq+q = q(p+1)$. Since $q$ is prime we have that $q-p-1|p+1$. But if $q-p-1|p+1$ then by the Euclidean Algorithim we must have $q-p-1|p+1+q-p-1 = q$. Thus $q-p-1|q$ and since $p+1>0$ we must have $q-p-1=1$ or $q-p=2$. Thus another possibility is $q-p=2$. Case 3: $n \equiv 0 \pmod{4}$. Then $n = 4a$ for some integer $a$. Then $\frac{q-p-1}{q(p+1)} = \frac{4}{4a+2} = \frac{2}{2a+1}$. Again, let's investigate $p=2$ first. If $p=2$ then $\frac{q-3}{3q} = \frac{2}{2a+1}$. We have $gcd(q-3,3q) = gcd(q-3,3q-3q+9) = gcd(q-3,9)$. Similar to what happened in case 1 we see that the only possibility is that $gcd(q-3,9)=1$ or $q-3=2 \implies q=5$. Thus, another solution to $q-p=5-2=3$. If $p$ is odd then $q(p+1) = even$ but $q-p-1=odd$. Thus the denominator will be even which contradicts the odd $2a+1$. Thus, the 3 possibilities for $q-p$ are $2,3,5$
13.05.2015 04:46
Our equation becomes \begin{align*} 1 - \frac{1}{p+1} + 1 + \frac{1}{q} &= 2 - \frac{4}{n+2} \\ \frac{1}{p+1} -\frac{1}{q} &= \frac{4}{n+2} \\ \frac{4(p+1)q}{q - p - 1} - 2 &= n \end{align*} We are given that $n > 0$ so therefore, we must have $q > p+1$ in order for the LHS in the last equation to be positive. This tells us that $\gcd{(p+1, q)} = 1$. Hence, we must have $q-p-1|4$. Thus, the possibles are $q-p - 1 \in \{ 1, 2, 4 \} \Rightarrow q - p \in \{ 2, 3, 5 \}$. Each of these is possible; take $(p, q) = (3, 5); (2, 5); (2, 7)$.
31.03.2017 21:50
yunxiu wrote: The numbers $p$ and $q$ are prime and satisfy \[\frac{p}{{p + 1}} + \frac{{q + 1}}{q} = \frac{{2n}}{{n + 2}}\]for some positive integer $n$. Find all possible values of $q-p$. Luxembourg (Pierre Haas) Here is my solution. The equation is equivalent to, $(n+2)(q-p-1)=4q(p+1).$ If $q$ devide $p+1$ then $$q-p-1=q-(p+1)\le q-q=0,$$which is impossible. Hence, $\gcd(p+1,q)=1.$ We consider two cases, If $p=2$ then the equation become $(n+2)(q-3)=12q.$ We see that $q-3$ devide $12q-12(q-3)=36$ and we deduce that $p=5,7.$ If $p>2$ then the number $q-p-1$ is odd, thus $4$ devide $n+2,$ hence $n+2=4n_1,$ where $n_1$ is a positive integer. The equation become, $n_1(q-p-1)=q(p+1).$ Because, $q-p-1$ devide $q(p+1),$ and $\gcd(q-p-1,p+1)=\gcd(q-p-1,q)=\gcd(p+1,q)=1,$ we deduce that $q-p-1=1,$ and that $q-p=2$ (twin primes!). We conclude that the possible values of $q-p$ are $2,3$ and $5.$
21.04.2018 07:51
26.10.2018 09:06
Note that $p$ and $q$ are distinct. We have $n+2$ to be divisible by both $p$and $q$ after simplifying the given equation. Writing $n+2$ as a multiple of $p$ and $q$ and simplifying the equation again tells us that $q-p-1 | 4.$ So, $q - p$ can be $2, 3 \: \text{or} \: 5$. $\blacksquare$
11.09.2019 18:23
The equation simplifies to $4pq+2p+2q+2 = nq-np-n$. We can see that $(p+1)(n+2) \equiv 0 \mod q$. We can also write the equation as $\frac{1}{p+1} - \frac{1}{q} = \frac{4}{n+2} \longrightarrow q >p+1$. So $q \mid n+2$. Let $n+2=mq$. Then $4pq+2p+2q +mq = (mq-2)(q-p) \iff 4pq+2q+mq= mq^2 -2q -mqp \iff 4p+2+m = mq-2-mp$. So $q \mid (m+4)(p+1)$. Let $m+4=tq$. Then $mq=(p+1)(m+4) \iff (tq-4)q=(p+1)(tq) \iff tq-4=pt+t$. So $t \mid 4$. Then $q-p= \frac{4+t}{t}$. So $t \in \{ 1,2, 4 \}$. Hence $q-p \in \boxed{\{ 2,3,5 \}}$. We can provide an example for each. Consider $(5,3), (5,2), (7,2)$. We are done.
18.05.2021 23:51
The answers are $q-p = 2, 3, 5$. These are possible for $(p,q)=(3,5), (2,5), (2,7)$. I am sure it is easy to find the corresponding $n$. We now show that these are the only solutions. It is easy to see that the given equation can be rearranged to $\frac{p-q+1}{q(p+1)}=-\frac{4}{n+2}$. Notice that because the right side is negative and the denominator on the left side is positive, it must be that $p-q+1<0\implies q > p+1$. The given equation simplifies to $(n+2)(q-p-1)=4q(p+1)$. To use the fact that $p$ and $q$ are primes, we can see that $\gcd(q,p+1)=1$ because $q$ is a prime and it is greater than $p+1$. Therefore, $q$ must divide the left side, which means that $q|n+2$. In similar fashion, we get that $p+1|n+2$. Let $n+2=kq(p+1),$ where $k\in \mathbb{Z}$. And suddenly, we are done!! We get that $4=k(q-p-1),$ and from here, because $q-p-1$ is positive, $k$ must be positive, so it $1,2,4$ and it is easy to check that the corresponding $q-p$ work in each case.
04.04.2022 01:06
The only possible values are $2$, $3$, and $5$. For constructions, consider $(3,5)$, $(2,5)$, and $(2,7)$, respectively. To prove these are the only values, we first write $\frac{p}{q+1} + \frac{q+1}{q} = \frac{2n}{n+2}\iff \frac{2pq + p + q + 1}{pq + q} = \frac{2n}{n+2}\iff \frac{q-p-1}{pq + q} = \frac{4}{n+2}$. In particular, $p < q$. However, we have $\text{gcd}(q - p - 1, pq + q) | pq + q + q(q - p - 1) = q^2$. But $q - p - 1 < q$, so $\text{gcd}(q - p - 1, pq + q) = 1$ and it follows that $q - p - 1 | 4$, as desired.
23.12.2024 13:15
CT17 wrote: The only possible values are $2$, $3$, and $5$. For constructions, consider $(3,5)$, $(2,5)$, and $(2,7)$, respectively. To prove these are the only values, we first write $\frac{p}{q+1} + \frac{q+1}{q} = \frac{2n}{n+2}\iff \frac{2pq + p + q + 1}{pq + q} = \frac{2n}{n+2}\iff \frac{q-p-1}{pq + q} = \frac{4}{n+2}$. In particular, $p < q$. However, we have $\text{gcd}(q - p - 1, pq + q) | pq + q + q(q - p - 1) = q^2$. But $q - p - 1 < q$, so $\text{gcd}(q - p - 1, pq + q) = 1$ and it follows that $q - p - 1 | 4$, as desired. Yep mine is similar but a little more complicated. Nice problem ig