Solve the equation $p^2-pq-q^3=1$ in prime numbers. A. Golovanov
Problem
Source: Tuymaada 2013, Day 2, Problem 7 Juniors and 6 Seniors
Tags: LaTeX, modular arithmetic, number theory proposed, number theory
22.07.2013 20:32
It turns out it is enough to know $q$ is a prime. Write the equation as $p^2 - qp - q^3 - 1 = 0$; its discriminant will be $\Delta = q^2 + 4q^3 + 4 = a^2$ in order for $p$ to be an integer. $\bullet$ The case $q=2$ leads to $p^2 - 2p - 9 = 0$, without integer solution(s). $\bullet$ The case $\boxed{q=3}$ leads to $p^2 - 3p - 28 = 0$, with positive integer root $\boxed{p=7}$ (a prime). Otherwise we have $q^2(4q+1) = a^2 - 4 = (a-2)(a+2)$. Since $\gcd(a-2,a+2) \mid 4$, and since $q>2$, we must have $q^2$ dividing just one of these factors. Since also $q>3$, we cannot have $q^2 \mid a-2$, as then it would follow $q^2 < 4q+1$, absurd. We are left with $q^2 \mid a+2$, and then $a-2 \mid 4q+1$, so $q^2 \leq 4q+5$. This is only possible for $q=5$, leading to $p^2 - 5p - 126 = 0$, with positive integer root $p=14$, not a prime. We thus have found all integer solutions to the given equation, under the sole condition that $q$ be a prime.
22.07.2013 22:38
Lemma: if $p=3k+2$, then $p$ can not divide $q^2-q+1$. Solution: $ p|q^3+1$ then by fermat we get a contradiction. Step 1) Easily see that $ p>3$, then $p^2=pq+q^3+1>2q+q^3+1>2q+q^2+1=(p+1)^2$, hence $p>q+1$, then $ p|q^3+1=(q+1)(q^2-q+1)$, and $q+1<p$, from this see that $ p|q^2-q+1$, hence $ p=3k+1$. Step 2) if $ q=3m+1$, then $1=p^2-pq-q^3 \equiv -1 (mod $ $3)$, a contradiction. Hence $ q=3m+2$ or $q=3$. if $q=3m+2$, then $ 1=p^2-pq -q^3 \equiv0 (mod 3)$, conradiction again. Hence $q=3$, and from this we easily get $p=7$. So$ (p,q)=(7,3)$ is the only solution.
23.07.2013 01:44
So you have discovered a solution that actually makes use of the fact $p$ is a prime! However, the lack of $\LaTeX$, some typos, and a poor justification for your Step 1. Lemma, all prompted me to do the following re-write. Step 1. Lemma. If $p\equiv 2 \pmod{3}$, then $p$ cannot divide $q^2-q+1$. Proof. Assume $p \mid q^2-q+1$ (so $p$ is odd); then $p \mid q^3+1$, so $q^3 \equiv -1 \pmod{p}$, thus $q^6 \equiv 1 \pmod{p}$. Let $\nu$ be the multiplicative order of $q$ modulo $p$; then $\nu \mid 6$, and $\nu \mid p-1$ (by Fermat's Little theorem). That forces $\nu = 2$ (since $\nu = 1$ means $q \equiv 1 \pmod{p}$, so $-1 \equiv q^3 \equiv 1 \pmod{p}$, forcing $p=2$, absurd), and so $q \equiv -1 \pmod{p}$. But then $0\equiv q^2-q+1 \equiv 1 + 1 + 1 = 3 \pmod{p}$, forcing $p=3$, absurd. Step 2. Easily $p>3$, then $p^2=pq+q^3+1>2q+q^3+1>2q+q^2+1=(q+1)^2$, hence $p>q+1$; but then from $p\mid q^3+1=(q+1)(q^2-q+1)$ follows that $p\mid q^2-q+1$, hence $p\equiv 1 \pmod{3}$. Step 3. If $q\equiv 1\pmod{3}$, then $1=p^2-pq-q^3 \equiv 1-1-1 = -1 \pmod{3}$, a contradiction. If $q\equiv 2\pmod{3}$, then $1=p^2 - pq - q^3 \equiv 1 - 2 + 1 = 0 \pmod{3}$, a contradiction again. Hence $q=3$ (the only moment where the primality of $q$ is actually used), and from this we easily get $p=7$. So $(p,q)=(7,3)$ is the only solution.
24.07.2013 21:06
mavropnevma wrote: It turns out it is enough to know $q$ is a prime. Well enough to know that $p$ is a prime. For the equation $2p^2-pq-q^3=1$ too.
26.07.2013 00:11
In a symmetrical (and funny) way, it also turns out it is enough to know $p$ is a prime. Writing the equation as $p^2 = q^3 +pq + 1 > q^2$, we get $p>q$, and even $p>q+1$ (since $(p,q)=(3,2)$ is not a solution). Writing now the equation as $p(p-q) = q^3+1 = (q+1)(q^2-q+1)$, it follows $p \mid q^2-q+1$, so there exists a positive integer $k$ such that $q^2-q+1 = kp$ and so $p-q = k(q+1)$, i.e. $p = (k+1)q + k$. With this substitution we get $q^2-q+1 = k((k+1)q + k) = k(k+1)q + k^2$, thus $q^2 - (k^2+k+1)q - k^2 + 1 = 0$. The discriminant of this equation will therefore be $\Delta = (k^2+k+1)^2 + 4k^2 -4$, needing to be a perfect square in order that $q$ be integer. But $\Delta = (k^2+k+3)^2 - 4k -12 < (k^2+k+3)^2$ for all $k> 0$, and in the same time $\Delta = (k^2+k+2)^2 + 2k^2 - 2k -7 > (k^2+k+2)^2$ for all $k > 2$. The value $k=2$ leads to $q^2 - 7q - 3 = 0$, with no integer solution, but $k=1$ leads to $q^2 - 3q = 0$, with the prime positive integer solution $\boxed{q=3}$, for which $\boxed{p=7}$ (a prime).
15.12.2016 22:45
mavropnevma wrote: Solve the equation $p^2-pq-q^3=1$ in prime numbers. A. Golovanov Let $p$ and $q$ be two prime numbers such the problem. The equation is equivalent to, $p(p-q)=(q+1)(q^2-q+1).$ Since, $q+1,q^2-q+1>0,$ we deduce that $p>q.$ We have $\gcd(p,p-q)=\gcd(p,q)=1$ and $q+1$ devide $p(p-q)$ so we have three cases, $\bullet$ If $q+1=1$ then $q=0$ which is impossible since $q$ is a prime number. $\bullet$ If $q+1=p$ then the equation is equivalent to $p-q=q^2-q+1$ but $p-q<p=q+1<q^2-q+1$ when $q\neq 2$ and when $q=2$ we have, $p(p-2)=9$ which is clearly impossible. $\bullet$ If $q+1$ devide $(p-q)+(q+1)=p+1$ so $\gcd(q+1,p)=1.$ Then, $p$ devide $q^2-q+1$ and thus, $p\le q^2-q+1.$ From the other hand, we have, $0<p-q<p\le q^2-q+1$ so, $q^2-q+1$ devide $p$ which impiles, $p\ge q^2-q+1.$ Thus, $p= q^2-q+1$ and the equation become, $2q+1=p.$ Therefore, $0=q^2-q+1-(2q+1)=q(q-3).$ So, $q=3$ and $p=2q+1=7.$ Finally, the only solution of this problem is $(p,q)=(7,3).$
10.09.2023 10:25
rightways wrote: Lemma: if $p=3k+2$, then $p$ can not divide $q^2-q+1$. Solution: $ p|q^3+1$ then by fermat we get a contradiction. Step 1) Easily see that $ p>3$, then $p^2=pq+q^3+1>2q+q^3+1>2q+q^2+1=(p+1)^2$, hence $p>q+1$, then $ p|q^3+1=(q+1)(q^2-q+1)$, and $q+1<p$, from this see that $ p|q^2-q+1$, hence $ p=3k+1$. Step 2) if $ q=3m+1$, then $1=p^2-pq-q^3 \equiv -1 (mod $ $3)$, a contradiction. Hence $ q=3m+2$ or $q=3$. if $q=3m+2$, then $ 1=p^2-pq -q^3 \equiv0 (mod 3)$, conradiction again. Hence $q=3$, and from this we easily get $p=7$. So$ (p,q)=(7,3)$ is the only solution. Sorry, what is proof for Lemma which you used?
11.09.2023 20:08
Answer:$(p,q)=(7,3).$ \[p(p-q)=(q+1)(q^2-q+1)\]We can see that $p>q$. For $p=3,q=2$ there's no solution. So we can say that $p>q+1$ which means $p$ doesn't divide $q+1$. $\implies p|q^2-q+1$ $\implies q+1|p-q+q+1=p+1$ Also we can write the equality as \[(p-1)(p+1)=q(q^2+p)\]If $q|p+1$ then \[q^2+q|p+1\]because $(q,q+1)=1$. But this means $q^2+q \leq p+1 \leq q^2-q+2$ $\implies q=1$ Contradiction $\implies q|p-1$ $p-1=qk$ such that $qk+1=p \leq q^2-q+1 \implies k \leq q-1$ We have $q+1|qk+2-2q-2=q(k-2)$ $q+1|k-2 \leq q+1$ So $k=q-1$ or $k=2$ $i)k=q-1$ $p=q^2-q+1 \implies q+1=p-q=q^2-2q+1 \implies q=3,p=7 $ $\implies \boxed{(7,3)}$ $ii)k=2$ $p=2q+1$ so \[(2q+1)^2-q(2q+1)-q^3=1\]\[q^2=2q+3\]We get $q=3$. So $p=7$. We get the same solution.