Daily

Random

Practice set

Baltic Way 2024 · Problem 20

Number Theory

Positive integers a,ba, b and cc satisfy the system of equations

{(ab−1)2=c(a2+b2)+ab+1a2+b2=c2+ab\left\{\begin{aligned} (a b-1)^{2} & =c\left(a^{2}+b^{2}\right)+a b+1 \\ a^{2}+b^{2} & =c^{2}+a b \end{aligned}\right.

(a) Prove that c+1c+1 is a perfect square. (b) Find all such triples (a,b,c)(a, b, c).

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Diophantine equations

Solutions

Solution 1

(a) Rearranging terms in the first equation gives

a2b2−2ab=c(a2+b2)+aba^{2} b^{2}-2 a b=c\left(a^{2}+b^{2}\right)+a b

By substituting ab=a2+b2−c2a b=a^{2}+b^{2}-c^{2} into the right-hand side and rearranging the terms we get

a2b2+c2=(c+1)(a2+b2)+2aba^{2} b^{2}+c^{2}=(c+1)\left(a^{2}+b^{2}\right)+2 a b

By adding 2abc2 a b c to both sides and factorizing we get

(ab+c)2=(c+1)(a+b)2(a b+c)^{2}=(c+1)(a+b)^{2}

Now it is obvious that c+1c+1 has to be a square of an integer. (b) Let us say c+1=d2c+1=d^{2}, where d>1d>1 and is an integer. Then substituting this into the equation (10) and taking the square root of both sides (we can do that as all the terms are positive) we get

ab+d2−1=d(a+b)a b+d^{2}-1=d(a+b)

We can rearrange it to (a−d)(b−d)=1(a-d)(b-d)=1, which immediately tells us that either a=b=d+1a=b=d+1 or a=b=d−1a=b=d-1. Note that in either case a=ba=b. Substituting this into the second equation of the given system we get a2=c2a^{2}=c^{2}, implying a=ca=c (as a,c>0)\left.a, c>0\right).

  • If a=b=d−1a=b=d-1, then a=ca=c gives d−1=d2−1d-1=d^{2}-1, so d=0d=0 or d=1d=1, neither of which gives a positive cc, so cannot be a solution.
  • If a=b=d+1a=b=d+1, then a=ca=c gives d+1=d2−1d+1=d^{2}-1, so d2−d−2=0d^{2}-d-2=0. The only positive solution is d=2d=2 which gives a=b=c=3a=b=c=3. Substituting it once again into both equations we indeed get a solution.
Solution 2

(a) Substituting a2+b2a^{2}+b^{2} from the second equation to the first one gives

(ab−1)2=c(c2+ab)+ab+1(a b-1)^{2}=c\left(c^{2}+a b\right)+a b+1

Rearranging terms in the obtained equation gives

(ab)2−(c+3)ab−c3=0(a b)^{2}-(c+3) a b-c^{3}=0

which we can consider as a quadratic equation in aba b. Its discriminant is

D=(c+3)2+4c3=4c3+c2+6c+9=(c+1)(4c2−3c+9)=(c+1)(4(c−1)2+5(c+1))D=(c+3)^{2}+4 c^{3}=4 c^{3}+c^{2}+6 c+9=(c+1)\left(4 c^{2}-3 c+9\right)=(c+1)\left(4(c-1)^{2}+5(c+1)\right)

To have solutions in integers, DD must be a perfect square. Note that c+1c+1 and 4(c−1)2+5(c+1)4(c-1)^{2}+5(c+1) can have no common odd prime factors. Hence gcd⁡(c+1,4(c−1)2+5(c+1))\operatorname{gcd}\left(c+1,4(c-1)^{2}+5(c+1)\right) is a power of 2 , so c+1c+1 and 4(c−1)2+5(c+1)4(c-1)^{2}+5(c+1) are either both perfect squares or both twice of some perfect squares. In the first case, we are done. In the second case, note that

4(c−1)2+5(c+1)≡4(c−1)2=(2(c−1))2( mod 5)4(c-1)^{2}+5(c+1) \equiv 4(c-1)^{2}=(2(c-1))^{2} \quad(\bmod 5)

so 4(c−1)2+5(c+1)4(c-1)^{2}+5(c+1) must be 0,1,40,1,4 modulo 5 . On the other hand, twice of a perfect square is 0,2,30,2,3 modulo 5 . Consequently, c+1≡0( mod 5)c+1 \equiv 0(\bmod 5) and 4(c−1)2+5(c+1)≡0( mod 5)4(c-1)^{2}+5(c+1) \equiv 0(\bmod 5), the latter of which implies c−1≡0( mod 5)c-1 \equiv 0(\bmod 5). This leads to contradiction since c−1c-1 and c+1c+1 cannot be both divisible by 5 . (b) By the solution of part (a), both c+1c+1 and 4c2−3c+94 c^{2}-3 c+9 are perfect squares. However, due to c>0c>0 we have (2c−1)2=4c2−4c+1<4c2−3c+9(2 c-1)^{2}=4 c^{2}-4 c+1<4 c^{2}-3 c+9, and for c>3c>3 we also have (2c)2=4c2>4c2−3c+9(2 c)^{2}=4 c^{2}>4 c^{2}-3 c+9. Thus 4c2−3c+94 c^{2}-3 c+9 is located between two consecutive perfect squares, which gives a contradiction with it being a square itself. Out of c=1,2,3c=1,2,3, only c=3c=3 makes c+1c+1 a perfect square. In this case, the quadratic equation (ab)2−(c+3)ab−c3=0(a b)^{2}-(c+3) a b-c^{3}=0 yields ab=9a b=9, so a=1,b=9a=1, b=9 or a=3,b=3a=3, b=3 or a=9,b=1a=9, b=1. Out of those, only a=3,b=3a=3, b=3 satisfies the equations. Remark: Part (a) of the problem can be solved yet another way. By substituting a2+b2a^{2}+b^{2} from the second equation to the first one, we obtain

(ab−1)2=c(c2+ab)+ab+1=c3+1+abc+ab=(c+1)(c2−c+1+ab)(a b-1)^{2}=c\left(c^{2}+a b\right)+a b+1=c^{3}+1+a b c+a b=(c+1)\left(c^{2}-c+1+a b\right)

Whenever an integer nn divides c+1c+1, it also divides ab−1a b-1. Therefore c≡−1( mod n)c \equiv-1(\bmod n) and ab≡1a b \equiv 1 ( mod n)(\bmod n). But then c2−c+1+ab≡4( mod n)c^{2}-c+1+a b \equiv 4(\bmod n), i.e., nn divides c2−c+1+ab−4c^{2}-c+1+a b-4. Thus the greatest common divisor of c+1c+1 and c2−c+1+abc^{2}-c+1+a b divides 4 , i.e., it is either 1,2 or 4 . In the first and third case we are done. If their greatest common divisor is 2 , then clearly all three of a,b,ca, b, c are odd, so a2≡b2≡c2≡1( mod 8)a^{2} \equiv b^{2} \equiv c^{2} \equiv 1(\bmod 8). Thus from the second equation we have ab=a2+b2−c2≡1a b=a^{2}+b^{2}-c^{2} \equiv 1 ( mod 8)(\bmod 8), so (ab−1)2(a b-1)^{2} is divisible by 64 . Now, if c≡1( mod 4)c \equiv 1(\bmod 4), then c2−c+1+ab≡2( mod 4)c^{2}-c+1+a b \equiv 2(\bmod 4), which means that (c+1)(c2−c+1+ab)≡4( mod 8)(c+1)\left(c^{2}-c+1+a b\right) \equiv 4(\bmod 8), giving a contradiction with (ab−1)2(a b-1)^{2} being divisible by 64 . If instead c≡3( mod 4)c \equiv 3(\bmod 4), then c2−c+1+ab≡0( mod 4)c^{2}-c+1+a b \equiv 0(\bmod 4). This means that both c+1c+1 and c2−c+1+abc^{2}-c+1+a b are divisible by 4 , giving a contradiction with the assumption that their greatest common divisor is 2 . Therefore c+1c+1 must be a perfect square.

Contest context

Results from Baltic Way 2024

11 teams

Mean score
1.1 / 5
Scores of 4 or 5
1 / 11
Estonia
2 / 5

Score distribution

07
10
22
31
40
51
All team scores
TeamScore
Poland0 / 5
Estonia2 / 5
Germany0 / 5
Ukraine0 / 5
Latvia5 / 5
Norway0 / 5
Lithuania3 / 5
Sweden2 / 5
Denmark0 / 5
Finland0 / 5
Iceland0 / 5