Library · Between the Challenge and the Olympiad · Chapter 4

Diophantine Equations

Revised Report an error
On this page
  1. Problems
  2. Solutions
  3. Solution: PRMO 2012, Q3
  4. Solution: IOQM 2026, Q10
  5. Solution: PRMO 2012, Q4
  6. Solution: PRMO 2015 Part A, Q2
  7. Solution: PRMO 2017, Q8
  8. Solution: PRMO 2017, Q12
  9. Solution: PRMO 2018, Q6
  10. Solution: IOQM 2025 Part SEP, Q7
  11. Solution: IOQM 2026, Q6
  12. Solution: PRMO 2012, Q5
  13. Solution: PRMO 2013, Q7
  14. Solution: PRMO 2013, Q10
  15. Solution: PRMO 2013, Q14
  16. Solution: PRMO 2014, Q14
  17. Solution: PRMO 2015 Part A, Q10
  18. Solution: PRMO 2019, Q9
  19. Solution: PRMO 2019, Q16
  20. Solution: IOQM 2022, Q4
  21. Solution: IOQM 2022, Q5
  22. Solution: IOQM 2022, Q6
  23. Solution: IOQM 2022, Q19
  24. Solution: IOQM 2023, Q3
  25. Solution: IOQM 2023, Q4
  26. Solution: IOQM 2024, Q13
  27. Solution: PRMO 2012, Q19
  28. Solution: PRMO 2017, Q23
  29. Solution: PRMO 2018, Q15
  30. Solution: IOQM 2020, Q13
  31. Solution: IOQM 2020, Q29
  32. Solution: IOQM 2023, Q11
  33. Solution: IOQM 2024, Q25
  34. Solution: IOQM 2024, Q26
  35. Solution: IOQM 2024, Q30
  36. Solution: IOQM 2025 Part SEP, Q28
  37. Solution: IOQM 2026, Q15
  38. Solution: IOQM 2026, Q28

Problems

Problem 1

For how many pairs of positive integers (x,y)(x, y) is x+3y=100x + 3y = 100?

Problem 2

What is the number of integers in the set {0,…,20}\{0, \ldots, 20\} which can be expressed as the sum of two square integers?

Problem 3

The letters RR, MM, and OO represent whole numbers. If R×M×O=240R \times M \times O = 240, R×O+M=46R \times O + M = 46 and R+M×O=64R + M \times O = 64, what is the value of R+M+OR + M + O?

Problem 4

Positive integers aa and bb are such that a+b=a/b+b/aa + b = a/b + b/a. What is the value of a2+b2a^2 + b^2?

Problem 5

A pen costs £11 and a notebook costs £13. Find the number of ways in which a person can spend exactly £1000 to buy pens and notebooks.

Problem 6

In a class, the total numbers of boys and girls are in the ratio 4:34 : 3. On one day it was found that 8 boys and 14 girls were absent from the class, and that the number of boys was the square of the number of girls. What is the total number of students in the class?

Problem 7

Integers aa, bb, cc satisfy a+b−c=1a + b - c = 1 and a2+b2−c2=−1a^2 + b^2 - c^2 = -1. What is the sum of all possible values of a2+b2+c2a^2 + b^2 + c^2?

Problem 8

The age of a person (in years) in 20252025 is a perfect square. His age (in years) was also a perfect square in 20122012. His age (in years) will be a perfect cube mm years after 20252025. Determine the smallest value of mm.

Problem 9

The height and the base radius of a closed right circular cylinder are positive integers and its total surface area is numerically equal to its volume. If its volume is kπk\pi where kk is a positive integer, what is the smallest possible value of kk?

Problem 10

Find the number of 22-digit positive integers nn such that n=26+(a×b)n = 26 + (a \times b), where aa and bb are the two digits of nn.

Problem 11

Let Sn=n2+20n+12S_n = n^2 + 20n + 12, nn a positive integer. What is the sum of all possible values of nn for which SnS_n is a perfect square?

Problem 12

Let Arthur and Beatrice together have nn marbles, where n>0n > 0.

Arthur says to Beatrice, “ If I give you some marbles then you will have twice as many marbles as I will have.” Beatrice says to Arthur, “ If I give you some marbles then you will have thrice as many marbles as I will have.”

What is the minimum possible value of nn for which the above statements are true?

Problem 13

Carol was given three numbers and was asked to add the largest of the three to the product of the other two. Instead, she multiplied the largest with the sum of the other two, but still got the right answer. What is the sum of the three numbers?

Problem 14

Let mm be the smallest odd positive integer for which 1+2+⋯+m1 + 2 + \cdots + m is a square of an integer and let nn be the smallest even positive integer for which 1+2+⋯+n1 + 2 + \cdots + n is a square of an integer. What is the value of m+nm + n?

Problem 15

One morning, each member of Megan’s family drank an 8-ounce mixture of coffee and milk. The amounts of coffee and milk varied from cup to cup, but were never zero. Megan drank 1/71/7-th of the total amount of milk and 2/172/17-th of the total amount of coffee. How many people are there in Megan’s family?

Problem 16

What is the greatest possible perimeter of a right-angled triangle with integer side lengths if one of the sides has length 12 ?

Problem 17

Let the rational number p/qp/q be closest to but not equal to 22/722/7 among all rational numbers with denominator <100< 100. What is the value of p−3qp - 3q?

Problem 18

A pen costs £1313 and a note book costs £1717. A school spends exactly £1000010000 in the year 2017-18 to buy xx pens and yy note books such that xx and yy are as close as possible (i.e., ∣x−y∣|x - y| is minimum). Next year, in 2018-19, the school spends a little more than £1000010000 and buys yy pens and xx note books. How much more did the school pay?

Problem 19

Starting with a positive integer MM written on the board, Alice plays the following game: in each move, if xx is the number on the board, she replaces it with 3x+23x + 2. Similarly, starting with a positive integer NN written on the board, Bob plays the following game: in each move, if xx is the number on the board, he replaces it with 2x+272x + 27. Given that Alice and Bob reach the same number after playing 4 moves each, find the smallest value of M+NM + N.

Problem 20

Let mm be the smallest positive integer such that m2+(m+1)2+⋯+(m+10)2m^2 + (m+1)^2 + \cdots + (m+10)^2 is the square of a positive integer nn. Find m+nm + n.

Problem 21

Let a,ba, b be positive integers satisfying a3−b3−ab=25a^3 - b^3 - ab = 25. Find the largest possible value of a2+b3a^2 + b^3.

Problem 22

Consider a string of nn 11’s. We wish to place some ++ signs in between so that the sum is 1000. For instance, if n=190n = 190, one may put ++ signs so as to get 11 ninety times and 1 ten times, and get the sum 1000. If aa is the number of positive integers nn for which it is possible to place ++ signs so as to get the sum 1000, then find the sum of the digits of aa.

Problem 23

Let α\alpha and β\beta be positive integers such that 1637<αβ<716.\frac{16}{37} < \frac{\alpha}{\beta} < \frac{7}{16}. Find the smallest possible value of β\beta.

Problem 24

Let x,yx, y be positive integers such that x4=(x−1)(y3−23)−1.x^4 = (x-1)(y^3 - 23) - 1. Find the maximum possible value of x+yx + y.

Problem 25

Three positive integers a,b,ca, b, c with a>ca > c satisfy the following equations: ac+b+c=bc+a+66,a+b+c=32.ac + b + c = bc + a + 66, \quad a + b + c = 32. Find the value of aa.

Problem 26

Consider a fraction ab≠34\dfrac{a}{b} \neq \dfrac{3}{4}, where a,ba, b are positive integers with gcd⁡(a,b)=1\gcd(a, b) = 1 and b≤15b \leq 15. If this fraction is chosen closest to 34\dfrac{3}{4} amongst all such fractions, then what is the value of a+ba + b?

Problem 27

How many integer pairs (x,y)(x, y) satisfy x2+4y2−2xy−2x−4y−8=0x^2 + 4y^2 - 2xy - 2x - 4y - 8 = 0?

Problem 28

Suppose an integer xx, a natural number nn and a prime number pp satisfy the equation 7x2−44x+12=pn7x^2 - 44x + 12 = p^n. Find the largest value of pp.

Problem 29

Let aa and bb be natural numbers such that 2a−b,a−2b2a - b, a - 2b and a+ba + b are all distinct squares. What is the smallest possible value of bb?

Problem 30

Find the sum of all positive integers nn for which ∣2n+5n−65∣|2^n + 5^n - 65| is a perfect square.

Problem 31

Positive integers a,b,ca, b, c satisfy aba−b=c\dfrac{ab}{a-b} = c. What is the largest possible value of a+b+ca + b + c not exceeding 99?

Problem 32

A positive integer mm has the property that m2m^2 is expressible in the form 4n2−5n+164n^2 - 5n + 16 where nn is an integer (of any sign). Find the maximum possible value of ∣m−n∣|m - n|.

Problem 33

A finite set MM of positive integers consists of distinct perfect squares and the number 9292. The average of the numbers in MM is 8585. If we remove 9292 from MM, the average drops to 8484. If N2N^2 is the largest possible square in MM, what is the value of NN?

Problem 34

The sum of ⌊x⌋\lfloor x \rfloor for all real numbers xx satisfying the equation 16+15x+15x2=⌊x⌋316 + 15x + 15x^2 = \lfloor x \rfloor^3 is:

Problem 35

Let ABCABC be a right-angled triangle with ∠B=90∘\angle B = 90^{\circ}. Let the length of the altitude BDBD be equal to 1212. What is the minimum possible length of ACAC, given that ACAC and the perimeter of triangle ABCABC are integers?

Not to scale.
Not to scale.

Problem 36

If aa and bb are positive integers satisfying 4a+4a2+4=b24^a + 4a^2 + 4 = b^2, what is the maximum possible value of a+ba + b.

Problem 37

Let a,b,c,da, b, c, d be positive integers such that a2+b2−cd2=2026a^2 + b^2 - cd^2 = 2026. Find the minimum possible value of a+b+c+da + b + c + d.

Problem 38

Let a1,a2,…a_1, a_2, \ldots and b1,b2,…b_1, b_2, \ldots be strictly increasing sequences of positive integers such that

(a) an+1=an+an−1a_{n+1} = a_n + a_{n-1} for n≥2n \geq 2

(b) bn=2bn−1b_n = 2b_{n-1} for all n≥2n \geq 2

(c) a10=b10<2026a_{10} = b_{10} < 2026.

Find the sum of all possible values of a1+b1a_1 + b_1.

Problem 39

Assume aa is a positive integer which is not a perfect square. Let x,yx, y be non-negative integers such that x−x+a=a−y\sqrt{x - \sqrt{x + a}} = \sqrt{a} - y. What is the largest possible value of aa such that a<100a < 100?

Solutions

Solution: PRMO 2012, Q3

Key idea

yy is free up to the point where x=100−3yx = 100 - 3y stops being positive.

For each positive integer yy the value x=100−3yx = 100 - 3y is determined, and it is positive exactly when 3y≤993y \le 99, that is y≤33y \le 33. Every such yy gives a valid pair, so there are 3333 pairs, from (97,1)(97, 1) to (1,33)(1, 33).

Answer 33

Solution: IOQM 2026, Q10

Key idea

Only 00, 11, 44, 99 and 1616 are squares small enough to matter, and listing their sums up to 2020 is quicker than any theory.

Zero is a square, 0=020 = 0^2, so a sum of two squares may use it. The squares up to 2020 are 0,1,4,9,160, 1, 4, 9, 16, and their sums in pairs, repeats allowed, that do not pass 2020 are 0=0+0,1=0+1,2=1+1,4=0+4,5=1+4,8=4+4,9=0+9,10=1+9,13=4+9,16=0+16,17=1+16,18=9+9,20=4+16.\begin{array}{llll} 0 = 0 + 0, & 1 = 0 + 1, & 2 = 1 + 1, & 4 = 0 + 4,\\ 5 = 1 + 4, & 8 = 4 + 4, & 9 = 0 + 9, & 10 = 1 + 9,\\ 13 = 4 + 9, & 16 = 0 + 16, & 17 = 1 + 16, & 18 = 9 + 9,\\ 20 = 4 + 16. & & & \end{array} The pairs 9+169 + 16 and 16+1616 + 16 pass 2020, so the list is complete, and it holds 1313 integers.

Answer 13

Solution: PRMO 2012, Q4

Key idea

Treating RORO as one unknown, the first two equations give RO+240RO=46RO + \tfrac{240}{RO} = 46, a quadratic with roots 4040 and 66.

Write p=R×Op = R \times O. The first equation says Mp=240M p = 240, so M=240/pM = 240/p, and substituting into the second, p+240p=46,p2−46p+240=0,p=40  or  6.p + \frac{240}{p} = 46, \qquad p^2 - 46p + 240 = 0, \qquad p = 40 \ \text{ or } \ 6.

Take the cases in turn. If p=40p = 40 then M=6M = 6, and the third equation reads R+6O=64R + 6O = 64 with RO=40RO = 40, so 40O+6O=64\tfrac{40}{O} + 6O = 64, that is 3O2−32O+20=03O^2 - 32O + 20 = 0, whose roots are 1010 and 23\tfrac23. Only O=10O = 10 is a whole number, giving R=4R = 4.

If p=6p = 6 then M=40M = 40 and R+40O=64R + 40O = 64 with RO=6RO = 6, leading to 20O2−32O+3=020O^2 - 32O + 3 = 0, whose roots 32\tfrac32 and 110\tfrac1{10} are both fractions.

So (R,M,O)=(4,6,10)(R, M, O) = (4, 6, 10), which satisfies all three equations, and R+M+O=20.R + M + O = 20.

Answer 20

Solution: PRMO 2015 Part A, Q2

Key idea

After clearing denominators, factor out the HCF. Each coprime part then divides the square of the other, forcing both parts to be 11.

Multiplying a+b=ab+baa + b = \dfrac{a}{b} + \dfrac{b}{a} through by abab gives ab(a+b)=a2+b2.ab(a+b) = a^2 + b^2. Now write d=gcd⁡(a,b)d = \gcd(a,b) and a=dxa = dx, b=dyb = dy with gcd⁡(x,y)=1\gcd(x,y) = 1. Substituting and cancelling d2d^2 from both sides, d xy(x+y)=x2+y2.d\,xy(x+y) = x^2 + y^2. This is where coprimality does the work. The number xx divides the left-hand side, so it divides x2+y2x^2 + y^2, and since it certainly divides x2x^2 it must divide y2y^2. But xx and yy share no factor, so x=1x = 1. The same argument on yy gives y=1y = 1.

With x=y=1x = y = 1 the equation reads 2d=22d = 2, so d=1d = 1 and therefore a=b=1a = b = 1. A quick check confirms it: 1+1=11+111 + 1 = \tfrac11 + \tfrac11. Hence a2+b2=2.a^2 + b^2 = 2.

Answer 2

Solution: PRMO 2017, Q8

Key idea

Solve 11p+13q=100011p + 13q = 1000 modulo 1313; the general solution is a single arithmetic progression, and counting is a matter of where it stays non-negative.

Let pp be the number of pens and qq the number of notebooks, so 11p+13q=100011p + 13q = 1000 with p,q≥0p, q \ge 0.

Work modulo 1313. Since 1000=76×13+121000 = 76 \times 13 + 12, the equation reads 11p≡1211p \equiv 12, and 11≡−211 \equiv -2, so −2p≡12-2p \equiv 12, that is p≡−6≡7(mod13)p \equiv -6 \equiv 7 \pmod{13}. Writing p=7+13tp = 7 + 13t, q=1000−11(7+13t)13=923−143t13=71−11t.q = \frac{1000 - 11(7 + 13t)}{13} = \frac{923 - 143t}{13} = 71 - 11t.

Both are non-negative exactly when 0≤t≤7111=6.45…0 \le t \le \tfrac{71}{11} = 6.45\ldots, that is t=0,1,…,6t = 0, 1, \ldots, 6. That is 77 ways, running from (p,q)=(7,71)(p,q) = (7,71) to (85,5)(85,5), and in every one of them the person buys at least one of each.

Answer 7

Solution: PRMO 2017, Q12

Key idea

One equation, 4k−8=(3k−14)24k - 8 = (3k-14)^2, and its two roots are separated by the requirement that kk be a whole number.

Let the numbers of boys and girls be 4k4k and 3k3k. On the day in question the numbers present are 4k−84k - 8 boys and 3k−143k - 14 girls, and we are told 4k−8=(3k−14)2.4k - 8 = (3k - 14)^2. Expanding, 9k2−84k+196=4k−89k^2 - 84k + 196 = 4k - 8, that is 9k2−88k+204=0.9k^2 - 88k + 204 = 0. The discriminant is 882−4⋅9⋅204=7744−7344=40088^2 - 4 \cdot 9 \cdot 204 = 7744 - 7344 = 400, so k=88±2018,k=6  or  k=6818.k = \frac{88 \pm 20}{18}, \qquad k = 6 \ \text{ or } \ k = \frac{68}{18}. Only k=6k = 6 is a whole number, so the class has 2424 boys and 1818 girls, a total of 4242.

The answer checks out: 24−8=1624 - 8 = 16 boys and 18−14=418 - 14 = 4 girls were present, and 16=4216 = 4^2.

Answer 42

Solution: PRMO 2018, Q6

Key idea

Substituting c=a+b−1c = a + b - 1 into the second equation collapses it to (a−1)(b−1)=1(a-1)(b-1) = 1, which has exactly two integer solutions.

From the first equation, c=a+b−1c = a + b - 1. Substituting into the second, a2+b2−(a+b−1)2=−1.a^2 + b^2 - (a+b-1)^2 = -1. Expanding (a+b−1)2=a2+b2+1+2ab−2a−2b(a+b-1)^2 = a^2 + b^2 + 1 + 2ab - 2a - 2b and cancelling, −2ab+2a+2b−1=−1,that isa+b=ab.-2ab + 2a + 2b - 1 = -1, \qquad \text{that is} \qquad a + b = ab. Rearranged, ab−a−b+1=1ab - a - b + 1 = 1, so (a−1)(b−1)=1.(a-1)(b-1) = 1.

Over the integers the only factorisations of 11 are 1×11 \times 1 and (−1)×(−1)(-1) \times (-1), giving (a,b)=(2,2)(a,b) = (2,2) or (a,b)=(0,0)(a,b) = (0,0). The corresponding cc are 33 and −1-1, and both really do satisfy the original pair: 4+4−9=−14 + 4 - 9 = -1 and 0+0−1=−10 + 0 - 1 = -1.

The two values of a2+b2+c2a^2 + b^2 + c^2 are 4+4+9=174 + 4 + 9 = 17 and 0+0+1=10 + 0 + 1 = 1, and their sum is 17+1=18.17 + 1 = 18.

Answer 18

Solution: IOQM 2025 Part SEP, Q7

Key idea

Two perfect squares differing by 1313 must be 3636 and 4949, since 1313 is prime and p2−q2=(p−q)(p+q)p^2 - q^2 = (p-q)(p+q).

The two ages differ by 2025−2012=132025 - 2012 = 13, so we need squares with p2−q2=13,(p−q)(p+q)=13.p^2 - q^2 = 13, \qquad (p-q)(p+q) = 13. As 1313 is prime and p+qp + q is the larger factor, p−q=1p - q = 1 and p+q=13p + q = 13, giving p=7p = 7 and q=6q = 6. So the person was 3636 in 20122012 and is 4949 in 20252025.

The next perfect cube at or beyond 4949 is 64=4364 = 4^3, reached 64−49=1564 - 49 = 15 years after 20252025. So m=15m = 15.

Answer 15

Solution: IOQM 2025 Part SEP, Q7

Key idea

Setting surface area equal to volume and cancelling πr\pi r gives rh−2r−2h=0rh - 2r - 2h = 0, which factors as (r−2)(h−2)=4(r-2)(h-2) = 4.

image

For a closed cylinder of radius rr and height hh, 2πr2+2πrh=πr2h.2\pi r^2 + 2\pi r h = \pi r^2 h. Dividing by πr\pi r, which is positive, gives 2r+2h=rh2r + 2h = rh, so rh−2r−2h+4=4,(r−2)(h−2)=4.rh - 2r - 2h + 4 = 4, \qquad (r-2)(h-2) = 4.

Both rr and hh are positive integers, and neither r−2r-2 nor h−2h-2 can be negative here, since a negative factor would force the other to be negative too and then r,h≤1r, h \le 1, which fails the equation. So the factorisations of 44 give (r,h)=(3,6),(4,4),(6,3),(r,h) = (3,6), \quad (4,4), \quad (6,3), with volumes πr2h\pi r^2 h equal to 54π54\pi, 64π64\pi and 108π108\pi.

The smallest value of kk is 5454.

Answer 54

Solution: IOQM 2026, Q6

Key idea

With n=10a+bn = 10a + b, the condition rearranges to (a−1)(10−b)=16(a - 1)(10 - b) = 16, and the ranges of the digits leave only three ways to split 1616.

Write n=10a+bn = 10a + b, where aa runs from 11 to 99 and bb from 00 to 99. The condition is 10a+b=26+ab10a + b = 26 + ab. Gathering everything that involves aa on one side, 10a−ab=26−b,a(10−b)=26−b.10a - ab = 26 - b, \qquad a(10 - b) = 26 - b. The right-hand side is (10−b)+16(10 - b) + 16, so subtracting 10−b10 - b from both sides gives (a−1)(10−b)=16.(a - 1)(10 - b) = 16.

Now a−1a - 1 lies between 00 and 88, and 10−b10 - b between 11 and 1010. Of the ways to write 1616 as a product of two positive integers, 1×161 \times 16 and 16×116 \times 1 each have a factor out of range, which leaves three: 2×8,4×4,8×2,2 \times 8,\quad 4 \times 4,\quad 8 \times 2, giving (a,b)=(3,2),(5,6),(9,8)(a, b) = (3, 2), (5, 6), (9, 8). Each checks: 32=26+632 = 26 + 6, 56=26+3056 = 26 + 30 and 98=26+7298 = 26 + 72. There are 33 such numbers.

Answer 3

Solution: PRMO 2012, Q5

Key idea

Completing the square turns SnS_n into (n+10)2−88(n+10)^2 - 88, so a square value means a difference of two squares equal to 8888.

Since n2+20n+12=(n+10)2−88n^2 + 20n + 12 = (n+10)^2 - 88, asking for Sn=k2S_n = k^2 is asking for (n+10)2−k2=88,(n+10−k)(n+10+k)=88.(n+10)^2 - k^2 = 88, \qquad (n + 10 - k)(n + 10 + k) = 88.

The two factors have the same parity, since they differ by 2k2k, and their product 8888 is even, so both are even. Writing 88=2×44=4×2288 = 2 \times 44 = 4 \times 22 (the split 8×118 \times 11 mixes parities), n+10=2+442=23  ⟹  n=13,n + 10 = \frac{2 + 44}{2} = 23 \implies n = 13, n+10=4+222=13  ⟹  n=3.n + 10 = \frac{4 + 22}{2} = 13 \implies n = 3. Both work: S13=441=212S_{13} = 441 = 21^2 and S3=81=92S_3 = 81 = 9^2.

The sum of all possible nn is 13+3=16.13 + 3 = 16.

Answer 16

Solution: PRMO 2013, Q7

Key idea

The two transfers require 3∣2a−b3\mid2a-b and 4∣3b−a4\mid3b-a. Expressing these quantities in terms of the total n=a+bn=a+b turns them into divisibility conditions on nn.

Let Arthur have aa marbles and Beatrice bb, with a+b=na + b = n.

Arthur’s statement is that for some whole number x≥1x \ge 1, giving away xx leaves b+x=2(a−x)b + x = 2(a - x), that is 3x=2a−b.3x = 2a - b. So 2a−b2a - b must be a positive multiple of 33, at least 33.

Beatrice’s is that for some y≥1y \ge 1, a+y=3(b−y)a + y = 3(b - y), that is 4y=3b−a,4y = 3b - a, so 3b−a3b - a is a positive multiple of 44, at least 44.

Now write both in terms of nn. Since b=n−ab = n - a, 2a−b=3a−n,3b−a=4b−n.2a - b = 3a - n, \qquad 3b - a = 4b - n. The first is a multiple of 33 exactly when 3∣n3 \mid n, and the second is a multiple of 44 exactly when 4∣n4 \mid n. So 12∣n12 \mid n.

And n=12n = 12 is achievable: take a=5a = 5 and b=7b = 7. Then 2a−b=32a - b = 3, so Arthur gives one marble and Beatrice is left with 88 against Arthur’s 44; and 3b−a=163b - a = 16, so Beatrice gives four marbles and Arthur has 99 against Beatrice’s 33. Both statements hold, so n=12.n = 12.

Answer 12

Solution: PRMO 2013, Q10

Key idea

The condition rearranges to c=aba+b−1c = \dfrac{ab}{a + b - 1}, and asking cc to be the largest forces a=b=1a = b = 1.

The statement never says what kind of numbers Carol was given, and that matters: over the positive reals the answer is not unique. Taking a=12a = \tfrac12, b=1b = 1 and c=1c = 1 satisfies the condition, since 1+12=32=1⋅321 + \tfrac12 = \tfrac32 = 1 \cdot \tfrac32, and the sum is 52\tfrac52 rather than 33. The intended reading, and the one that gives a single answer, is that the three numbers are positive integers, and that is what is assumed below.

Let the three numbers be a≤b≤ca \le b \le c, positive integers, with cc the largest. Carol should have computed c+abc + ab and instead computed c(a+b)c(a+b), and the two agreed: c+ab=c(a+b).c + ab = c(a+b). Solving for cc, c(1−a−b)=−ab,c=aba+b−1.c\bigl(1 - a - b\bigr) = -ab, \qquad c = \frac{ab}{a + b - 1}.

Now use the fact that cc is the largest, so c≥bc \ge b: aba+b−1≥b  ⟹  a≥a+b−1  ⟹  b≤1.\frac{ab}{a+b-1} \ge b \implies a \ge a + b - 1 \implies b \le 1. So b=1b = 1, and since a≤ba \le b we may as well take a≤1a \le 1 too, giving a=1a = 1. Then c=11+1−1=1.c = \frac{1}{1 + 1 - 1} = 1.

The three numbers are 11, 11, 11, and indeed 1+1×1=2=1×(1+1)1 + 1 \times 1 = 2 = 1 \times (1+1). Their sum is 3.3.

Answer 3

Solution: PRMO 2013, Q14

Key idea

The one-term sum counts as a square triangular number. After checking the smallest odd index, test even indices in order; no general theory is needed.

Write Tk=1+2+⋯+k=12k(k+1)T_k = 1 + 2 + \cdots + k = \tfrac12 k(k+1). Nothing needs to be known about which triangular numbers are squares in general, because both answers are found by looking at the first few.

The smallest odd index is immediate: T1=1=12T_1 = 1 = 1^2, so m=1m = 1.

For the smallest even index, take the even values in turn: T2=3,T4=10,T6=21,T8=36=62.T_2 = 3, \qquad T_4 = 10, \qquad T_6 = 21, \qquad T_8 = 36 = 6^2. None of the first three is a square, and the fourth is, so n=8n = 8. Hence m+n=1+8=9.m + n = 1 + 8 = 9.

A word on m=1m = 1, which surprises some readers. The sum 1+2+⋯+m1 + 2 + \cdots + m with m=1m = 1 is just 11, and 11 is a square, so the condition is met. If one insists on at least two terms, the smallest odd index becomes 4949 and the answer would be 5757; the question as printed does not say that, so the answer is 99.

Answer 9

Solution: PRMO 2014, Q14

Key idea

Megan’s own eight ounces give one equation in the totals of milk and coffee, and the family’s total gives another; positivity then leaves a single family size.

Let there be nn people, so the family drank 8n8n ounces in all. Write MM for the total milk and CC for the total coffee, so M+C=8nM + C = 8n.

Megan drank eight ounces, made of 17\tfrac17 of the milk and 217\tfrac{2}{17} of the coffee: M7+2C17=8,that is17M+14C=952.\frac{M}{7} + \frac{2C}{17} = 8, \qquad \text{that is} \qquad 17M + 14C = 952.

Substituting M=8n−CM = 8n - C gives 136n−3C=952136n - 3C = 952, so C=136n−9523,M=8n−C=952−112n3.C = \frac{136n - 952}{3}, \qquad M = 8n - C = \frac{952 - 112n}{3}.

Both totals are positive, since every cup contained some of each: C>0  ⟹  n>7,M>0  ⟹  n<8.5.C > 0 \implies n > 7, \qquad M > 0 \implies n < 8.5. The only integer between is n=8.n = 8. Then C=1363C = \tfrac{136}{3} and M=563M = \tfrac{56}{3} ounces, which do sum to 64=8×864 = 8 \times 8.

That n=8n = 8 is forced does not by itself show that eight people can actually be served, so here is a distribution that works. Megan takes 17\tfrac17 of the milk and 217\tfrac{2}{17} of the coffee, namely 83\tfrac83 ounces of milk and 163\tfrac{16}{3} of coffee, which is eight ounces. That leaves 1616 ounces of milk and 4040 of coffee for the other seven, so give each of them 167\tfrac{16}{7} of milk and 407\tfrac{40}{7} of coffee, again eight ounces. Every cup contains some of each, as the question requires.

The fractions 17\tfrac17 and 217\tfrac{2}{17} were chosen to squeeze the answer between two consecutive integers, which is the whole mechanism: one drinker’s share of each ingredient bounds the number of drinkers from both sides.

Answer 8

Solution: PRMO 2015 Part A, Q10

Key idea

If 1212 is a leg then 144=(c−b)(c+b)144 = (c-b)(c+b), and to make the perimeter large we want c+bc + b large, which means taking the factorisation as lopsided as parity allows.

image

There are two cases, and one of them is quickly dismissed. If 1212 were the hypotenuse then both legs are less than 1212 and the perimeter is under 3636, which will turn out to be far from the best. So take 1212 as a leg, with the other leg bb and hypotenuse cc, both positive integers. Then b2+144=c2b^2 + 144 = c^2, that is (c−b)(c+b)=144.(c-b)(c+b) = 144. The perimeter is 12+b+c12 + b + c, so we want b+cb + c as large as possible. Writing c−b=uc - b = u and c+b=vc + b = v with uv=144uv = 144, we want vv as large as possible, hence uu as small as possible.

Two constraints bite. First, uu and vv have the same parity, because u+v=2cu + v = 2c is even, and since their product 144144 is even they must both be even. Second, v>uv > u, so that b>0b > 0. The smallest even value of uu is 22, giving v=72v = 72, and then c=u+v2=37,b=v−u2=35.c = \frac{u+v}{2} = 37, \qquad b = \frac{v-u}{2} = 35. A check confirms the triangle: 122+352=144+1225=1369=37212^2 + 35^2 = 144 + 1225 = 1369 = 37^2. The perimeter is 12+35+37=8412 + 35 + 37 = 84.

Why does u=1u = 1 fail, one might reasonably ask, since it would give the larger v=144v = 144. It fails because then c=1452c = \tfrac{145}{2} is not an integer. The parity condition is doing real work, and it is the step most often skipped.

Answer 84

Solution: PRMO 2019, Q9

Key idea

The gap between p/qp/q and 22/722/7 is ∣7p−22q∣/(7q)|7p - 22q|/(7q), a fraction whose numerator is a positive integer, so the gap is smallest when the numerator is 11 and qq is as large as allowed.

For any fraction p/qp/q with q<100q < 100, ∣pq−227∣=∣7p−22q∣7q.\left|\frac{p}{q} - \frac{22}{7}\right| = \frac{|7p - 22q|}{7q}. The numerator ∣7p−22q∣|7p - 22q| is a non-negative integer, and it is zero only when p/qp/q equals 22/722/7, which is excluded. So it is at least 11, and ∣pq−227∣≥17q≥17×99=1693.\left|\frac{p}{q} - \frac{22}{7}\right| \ge \frac{1}{7q} \ge \frac{1}{7 \times 99} = \frac{1}{693}.

Equality needs both q=99q = 99 and ∣7p−22q∣=1|7p - 22q| = 1, so 7p=22×99±1=2178±17p = 22 \times 99 \pm 1 = 2178 \pm 1. Of the two, 2177=7×3112177 = 7 \times 311 is divisible by 77 while 21792179 is not. Hence the unique closest fraction is pq=31199,\frac{p}{q} = \frac{311}{99}, and it does sit at distance exactly 1/6931/693, so the bound is attained. Finally p−3q=311−297=14.p - 3q = 311 - 297 = 14.

The reason the search space collapses so fast is worth noting. Denominators near the limit are the only ones that can be good, because a small denominator forces the fraction onto a coarse grid. That is the same principle behind continued fractions, of which 22/722/7 is the most famous example.

Answer 14

Solution: PRMO 2019, Q16

Key idea

Swapping the two orders changes the bill by 4(x−y)4(x-y), so the whole question is how close xx and yy can be, and the general solution of the linear equation answers that in one step.

First solve 13x+17y=1000013x + 17y = 10000 in non-negative integers. Working modulo 1717, and using 10000=17×588+410000 = 17 \times 588 + 4, 13x≡4(mod17).13x \equiv 4 \pmod{17}. Since 13≡−413 \equiv -4, this reads −4x≡4-4x \equiv 4, that is x≡−1≡16(mod17)x \equiv -1 \equiv 16 \pmod{17}. So x=16+17t,y=10000−13(16+17t)17=576−13t,x = 16 + 17t, \qquad y = \frac{10000 - 13(16+17t)}{17} = 576 - 13t, and both are non-negative exactly for 0≤t≤440 \le t \le 44.

Now measure the gap: x−y=(16+17t)−(576−13t)=30t−560.x - y = (16 + 17t) - (576 - 13t) = 30t - 560. This vanishes at t=1823t = 18\tfrac23, so the integer candidates are t=18t = 18, giving x−y=−20x - y = -20, and t=19t = 19, giving x−y=10x - y = 10. The minimum of ∣x−y∣|x-y| is therefore 1010, attained at t=19t = 19: x=339,y=329,13×339+17×329=10000.x = 339, \qquad y = 329, \qquad 13 \times 339 + 17 \times 329 = 10000.

The following year the school buys yy pens and xx notebooks, so it pays 13y+17x13y + 17x. The difference is (13y+17x)−(13x+17y)=4(x−y)=4×10=40.(13y + 17x) - (13x + 17y) = 4(x - y) = 4 \times 10 = 40. The school paid £4040 more, and one may check it directly: 13×329+17×339=4277+5763=1004013 \times 329 + 17 \times 339 = 4277 + 5763 = 10040.

The identity 4(x−y)4(x-y) is the whole reason the question insisted that xx and yy be as close as possible. Swapping the two quantities in a purchase always costs the price difference times the quantity difference, here (17−13)(x−y)(17 - 13)(x - y).

Answer 40

Solution: IOQM 2022, Q4

Key idea

Iterating a linear map four times is still a linear map, so both games collapse to a single equation, and the rest is a congruence.

The successive values show how the starting numbers and added constants grow: moveAliceBob13M+22N+2729M+84N+81327M+268N+189481M+8016N+405\begin{array}{c|c|c} \text{move}&\text{Alice}&\text{Bob}\\\hline 1&3M+2&2N+27\\ 2&9M+8&4N+81\\ 3&27M+26&8N+189\\ 4&81M+80&16N+405 \end{array} Setting them equal, 81M+80=16N+405,that is81M−16N=325.81M + 80 = 16N + 405, \qquad \text{that is} \qquad 81M - 16N = 325.

We want the smallest M+NM + N in positive integers, so read the equation modulo 1616, where the awkward coefficient becomes harmless: 81≡181 \equiv 1, and 325=20⋅16+5325 = 20 \cdot 16 + 5, so M≡5(mod16).M \equiv 5 \pmod{16}. So M=5+16tM = 5 + 16t for some integer t≥0t \ge 0, and substituting back gives 16N=81(5+16t)−325=80+1296t16N = 81(5+16t) - 325 = 80 + 1296t, that is N=5+81tN = 5 + 81t. Hence M+N=10+97t,M + N = 10 + 97t, which is smallest at t=0t = 0, where M=N=5M = N = 5 and both are positive. The minimum is M+N=10M + N = 10.

Answer 10

Solution: IOQM 2022, Q5

Key idea

Centre the eleven squares on m+5m+5: the linear terms cancel in pairs. The remaining factor 1111 forces 11∣n11\mid n, leaving a short integer search.

Eleven consecutive squares suggest centring the run, so write the terms as (m+5−5)2,…,(m+5+5)2(m+5-5)^2, \ldots, (m+5+5)^2 and let u=m+5u = m+5. The cross terms cancel in pairs and ∑k=−55(u+k)2=11u2+2u∑k=−55k+∑k=−55k2=11u2+110.\sum_{k=-5}^{5}(u+k)^2 = 11u^2 + 2u\sum_{k=-5}^{5}k + \sum_{k=-5}^{5}k^2 = 11u^2 + 110.

So we need 11(u2+10)=n211(u^2 + 10) = n^2. Since 1111 is prime and divides n2n^2, it divides nn; writing n=11tn = 11t and cancelling gives u2+10=11t2,that isu2−11t2=−10.u^2 + 10 = 11t^2, \qquad \text{that is} \qquad u^2 - 11t^2 = -10.

Now hunt for the smallest solution with u>5u > 5, since m=u−5m = u - 5 must be positive. Testing tt in turn, 11t2−1011t^2 - 10 must be a perfect square: t=1t=1 gives 11, so u=1u=1 and m=−4m = -4, which is not positive; t=2,3,4,5,6t = 2, 3, 4, 5, 6 give 34,89,166,265,38634, 89, 166, 265, 386, none of them squares; and t=7t = 7 gives 11⋅49−10=529=23211 \cdot 49 - 10 = 529 = 23^2.

The first admissible tt is also the best one, because the quantity we are minimising is m+n=(u−5)+11tm + n = (u - 5) + 11t, and u=11t2−10u = \sqrt{11t^2 - 10} increases with tt, so both terms do.

So u=23u = 23, hence m=18m = 18, and n=11t=77n = 11t = 77. Checking, the eleven squares from 18218^2 to 28228^2 do sum to 5929=7725929 = 77^2. Therefore m+n=18+77=95m + n = 18 + 77 = 95.

Answer 95

Solution: IOQM 2022, Q6

Key idea

Bound the gap a−ba - b. If it is two or more the left side races past 2525, so a=b+1a = b+1 and the cubic collapses to a quadratic.

Since a3−b3=25+ab>0a^3 - b^3 = 25 + ab > 0 we know a>ba > b, so the gap a−ba - b is a positive integer, and the useful question is how large it can be.

For fixed bb, increasing aa by 11 changes a3−b3−aba^3-b^3-ab by 3a2+3a+1−b3a^2+3a+1-b, positive when a>ba>b. Thus if a≥b+2a\ge b+2, its smallest possible value occurs at a=b+2a=b+2, and a3−b3−ab≥(b+2)3−b3−b(b+2)=5b2+10b+8,a^3 - b^3 - ab \geq (b+2)^3 - b^3 - b(b+2) = 5b^2 + 10b + 8, which already exceeds 2525 for every b≥2b \geq 2. That leaves only b=1b = 1 with a≥3a \geq 3, where the condition reads a3−1−a=25a^3 - 1 - a = 25, so a3−a=26a^3 - a = 26; but 33−3=243^3 - 3 = 24 and 43−4=604^3 - 4 = 60, so there is no solution. Hence a=b+1a = b + 1.

Substituting a=b+1a = b+1 turns the cubic into a quadratic: (b+1)3−b3−b(b+1)=3b2+3b+1−b2−b=2b2+2b+1=25,(b+1)^3 - b^3 - b(b+1) = 3b^2 + 3b + 1 - b^2 - b = 2b^2 + 2b + 1 = 25, so b2+b−12=0b^2 + b - 12 = 0 and (b+4)(b−3)=0(b+4)(b-3) = 0. Only b=3b = 3 is positive, giving a=4a = 4, and indeed 64−27−12=2564 - 27 - 12 = 25.

The solution is unique, so the largest value of a2+b3a^2 + b^3 is the only one: 16+27=4316 + 27 = 43.

Answer 43

Solution: IOQM 2022, Q19

Key idea

Only three repunits are small enough to use. Counting the digits used rather than the values turns the question into finding how many values b+12cb + 12c can take.

Placing plus signs in a string of 11s produces a sum of repunits, and since 1111>10001111 > 1000 only 11, 1111 and 111111 can appear. Suppose we use α\alpha ones, β\beta elevens and γ\gamma one hundred and elevens, so that α+11β+111γ=1000,n=α+2β+3γ.\alpha + 11\beta + 111\gamma = 1000, \qquad n = \alpha + 2\beta + 3\gamma.

Eliminate α\alpha using the first equation. Substituting α=1000−11β−111γ\alpha = 1000 - 11\beta - 111\gamma, n=1000−9β−108γ=1000−9(β+12γ).n = 1000 - 9\beta - 108\gamma = 1000 - 9\left(\beta + 12\gamma\right). So nn is determined by the single quantity w=β+12γw = \beta + 12\gamma, and counting the achievable nn is the same as counting the achievable ww.

The constraint is α≥0\alpha \geq 0, that is 11β+111γ≤100011\beta + 111\gamma \leq 1000. For each γ\gamma from 00 to 99 this allows β\beta from 00 up to ⌊1000−111γ11⌋\left\lfloor \tfrac{1000 - 111\gamma}{11} \right\rfloor, and the resulting ww fills the interval from 12γ12\gamma to 12γ+⌊1000−111γ11⌋12\gamma + \left\lfloor \tfrac{1000-111\gamma}{11} \right\rfloor. Their endpoints are all visible in one table: γ0123456789min⁡w01224364860728496108max⁡w9092949698100102104106108\begin{array}{c|rrrrrrrrrr} \gamma&0&1&2&3&4&5&6&7&8&9\\\hline \min w&0&12&24&36&48&60&72&84&96&108\\ \max w&90&92&94&96&98&100&102&104&106&108 \end{array} Each interval through γ=8\gamma=8 starts before the preceding one ends, so their union contains every integer from 00 to 106106. The final case γ=9\gamma = 9 forces β=0\beta = 0 and contributes the isolated value w=108w = 108.

So ww takes 107+1=108107 + 1 = 108 values, and 107107 is the one gap. Hence a=108a = 108, and the sum of its digits is 1+0+8=91 + 0 + 8 = 9.

Answer 9

Solution: IOQM 2023, Q3

Key idea

Each strict inequality between fractions is really a statement that a positive integer is at least 11, and combining the two with the right weights produces 3β3\beta as a sum of multiples of 1616 and 3737.

Since α\alpha and β\beta are positive integers, the inequality 1637<αβ\dfrac{16}{37} < \dfrac{\alpha}{\beta} says 37α−16β>037\alpha - 16\beta > 0, and an integer greater than zero is at least 11. The same applies on the other side. So there are positive integers uu and vv with 37α−16β=u≥1,7β−16α=v≥1.37\alpha - 16\beta = u \ge 1, \qquad 7\beta - 16\alpha = v \ge 1.

Now eliminate α\alpha. Multiplying the first by 1616 and the second by 3737 and adding, 16u+37v=(592α−256β)+(259β−592α)=3β.16u + 37v = (592\alpha - 256\beta) + (259\beta - 592\alpha) = 3\beta. That single line is the whole problem: 3β3\beta must be expressible as 16u+37v16u + 37v with uu and vv positive integers.

Two constraints then pin β\beta down. First, reading the equation modulo 33 and using 16≡116 \equiv 1 and 37≡137 \equiv 1, we get u+v≡0(mod3)u + v \equiv 0 \pmod 3. Second, we want 16u+37v16u + 37v as small as possible. Take v=1v = 1: then u+1u + 1 must be a multiple of 33, so u≥2u \ge 2, and the smallest value is 16⋅2+37=6916 \cdot 2 + 37 = 69, giving β=23\beta = 23. Take v≥2v \ge 2 instead: then 16u+37v≥16+74=90>6916u + 37v \ge 16 + 74 = 90 > 69. So no smaller β\beta is possible.

It remains to confirm that β=23\beta = 23 really occurs. From u=2u = 2 and v=1v = 1 we get 37α=16⋅23+2=37037\alpha = 16 \cdot 23 + 2 = 370, so α=10\alpha = 10, and indeed 1637<1023<716,\frac{16}{37} < \frac{10}{23} < \frac{7}{16}, both by cross-multiplication: 16⋅23=368<370=10⋅3716 \cdot 23 = 368 < 370 = 10 \cdot 37, and 10⋅16=160<161=7⋅2310 \cdot 16 = 160 < 161 = 7 \cdot 23.

Answer 23

Solution: IOQM 2023, Q4

Key idea

Rearranged, the equation says x−1x-1 divides x4+1x^4+1, and since x≡1x \equiv 1 modulo x−1x-1 that forces x−1x-1 to divide 22.

Move the −1-1 across to get x4+1=(x−1)(y3−23),x^4 + 1 = (x-1)(y^3 - 23), The case x=1x=1 would give 1=−11=-1 in the original equation, so x>1x>1. Hence x−1x-1 divides x4+1x^4+1. This is the kind of divisibility that collapses immediately, because modulo x−1x-1 we have x≡1x \equiv 1, hence x4+1≡14+1=2(modx−1).x^4 + 1 \equiv 1^4 + 1 = 2 \pmod{x-1}. Therefore x−1x - 1 divides 22, leaving only x=2x = 2 and x=3x = 3.

Each candidate is now a single line of arithmetic. If x=2x = 2 then 17=y3−2317 = y^3 - 23, so y3=40y^3 = 40, and 4040 is not a cube. If x=3x = 3 then 82=2(y3−23)82 = 2(y^3 - 23), so y3=64y^3 = 64 and y=4y = 4, which is a genuine solution.

Only one pair survives, so the maximum of x+yx + y is 3+4=73 + 4 = 7.

Answer 7

Solution: IOQM 2024, Q13

Key idea

Rearranged, the first equation factorises as (c−1)(a−b+1)=65(c-1)(a-b+1) = 65, and 6565 has few factorisations.

Move everything to one side of ac+b+c=bc+a+66ac + b + c = bc + a + 66: ac−bc−a+b+c=66.ac - bc - a + b + c = 66. The first four terms group as c(a−b)−(a−b)=(a−b)(c−1)c(a-b) - (a-b) = (a-b)(c-1), so (a−b)(c−1)+c=66,that is(a−b)(c−1)+(c−1)=65,(a-b)(c-1) + c = 66, \qquad \text{that is} \qquad (a-b)(c-1) + (c-1) = 65, and therefore (c−1) (a−b+1)=65.(c-1)\,(a - b + 1) = 65. The step of writing cc as (c−1)+1(c-1) + 1 is the one that makes the whole thing factor, and it is worth looking for whenever a stray linear term spoils an otherwise clean grouping.

Since 65=5⋅1365 = 5 \cdot 13, the factor c−1c - 1 is one of 1,5,13,651, 5, 13, 65. Combine each case with a+b+c=32a+b+c = 32: c−1ca−b(a,b)1264a+b=30⇒b=−17, rejected5612a+b=26⇒(19,7)13144a+b=18⇒(11,7)65660c>32, rejected\begin{array}{c|c|c|c} c-1 & c & a - b & (a, b) \\ \hline 1 & 2 & 64 & a+b = 30 \Rightarrow b = -17, \text{ rejected} \\ 5 & 6 & 12 & a+b = 26 \Rightarrow (19, 7) \\ 13 & 14 & 4 & a+b = 18 \Rightarrow (11, 7) \\ 65 & 66 & 0 & c > 32, \text{ rejected} \end{array} Two candidates survive the positivity requirement, and the condition a>ca > c decides between them: (a,b,c)=(11,7,14)(a,b,c) = (11,7,14) has a<ca < c, while (19,7,6)(19,7,6) has a>ca > c as required. A check confirms it: 19⋅6+7+6=12719 \cdot 6 + 7 + 6 = 127 and 7⋅6+19+66=1277 \cdot 6 + 19 + 66 = 127.

So a=19a = 19.

Answer 19

Solution: IOQM 2025 Part SEP, Q7

Key idea

The distance from 34\tfrac34 is ∣3b−4a∣4b\dfrac{|3b - 4a|}{4b}, whose numerator is a positive integer, so the fraction to beat is the one with ∣3b−4a∣=1|3b-4a| = 1 and bb as large as allowed.

For any fraction ab≠34\tfrac ab \ne \tfrac34, ∣34−ab∣=∣3b−4a∣4b.\left| \frac34 - \frac ab \right| = \frac{|3b - 4a|}{4b}. The numerator is a positive integer, so the distance is at least 14b≥160\dfrac{1}{4b} \ge \dfrac{1}{60} because b≤15b \le 15.

Can 160\dfrac1{60} be attained? That needs b=15b = 15 and ∣3⋅15−4a∣=1|3 \cdot 15 - 4a| = 1, that is 4a=444a = 44 or 4646. The first gives a=11a = 11, and gcd⁡(11,15)=1\gcd(11,15) = 1, so 1115is at distance∣45−4460∣=160.\frac{11}{15} \qquad \text{is at distance} \qquad \left|\frac{45 - 44}{60}\right| = \frac1{60}.

Nothing else comes closer, since any other fraction has b≤15b \le 15 and numerator at least 11, and equality in 14b=160\tfrac1{4b} = \tfrac1{60} forces b=15b = 15. So a+b=11+15=26a + b = 11 + 15 = 26.

Answer 26

Solution: PRMO 2012, Q19

Key idea

Read it as a quadratic in xx: the discriminant is −12(y−3)(y+1)-12(y-3)(y+1), which is non-negative only for −1≤y≤3-1 \le y \le 3.

Collect the terms in xx: x2−(2y+2)x+(4y2−4y−8)=0.x^2 - (2y+2)x + \left(4y^2 - 4y - 8\right) = 0. Its discriminant is (2y+2)2−4(4y2−4y−8)=−12y2+24y+36,(2y+2)^2 - 4\left(4y^2 - 4y - 8\right) = -12y^2 + 24y + 36, which factorises as −12(y−3)(y+1)-12(y-3)(y+1).

For a real solution this must be non-negative, so −1≤y≤3-1 \le y \le 3, and for an integer solution it must also be a perfect square. Checking the five values:

  • y=−1y = -1: discriminant 00, giving x=0x = 0.

  • y=0y = 0: discriminant 3636, giving x=4x = 4 or x=−2x = -2.

  • y=1y = 1: discriminant 4848, not a square.

  • y=2y = 2: discriminant 3636, giving x=6x = 6 or x=0x = 0.

  • y=3y = 3: discriminant 00, giving x=4x = 4.

That is six pairs in all: (0,−1)(0,-1), (4,0)(4,0), (−2,0)(-2,0), (6,2)(6,2), (0,2)(0,2) and (4,3)(4,3).

Answer 6

Solution: PRMO 2017, Q23

Key idea

The quadratic factorises as (7x−2)(x−6)(7x-2)(x-6), and a prime dividing both factors would divide 4040, so a large prime forces one factor to be ±1\pm1.

The left-hand side factorises: 7x2−44x+12=(7x−2)(x−6).7x^2 - 44x + 12 = (7x - 2)(x - 6). So we need (7x−2)(x−6)=pn(7x-2)(x-6) = p^n. If the convention in force allows n=0n = 0, that case dies at once: the product would be 11, forcing both factors to be 11 or both to be −1-1, and 7x−27x - 2 is neither for any integer xx. So n≥1n \ge 1 and the right-hand side is a genuine power of a prime.

Each factor is therefore ±\pm a power of pp, and the two signs agree since the product is positive. Suppose both factors are divisible by pp. Then pp divides (7x−2)−7(x−6)=40,(7x - 2) - 7(x - 6) = 40, so pp is 22 or 55. Those are small, so a large pp requires one factor to have no pp in it at all, that is to be ±1\pm1.

Check the possibilities. The factor 7x−27x - 2 is ≡5(mod7)\equiv 5 \pmod 7, so it is never ±1\pm1. That leaves x−6=±1x - 6 = \pm1:

  • x=7x = 7: then x−6=1x - 6 = 1 and 7x−2=477x - 2 = 47, so pn=47p^n = 47, a prime.

  • x=5x = 5: then x−6=−1x - 6 = -1 and 7x−2=337x - 2 = 33, giving −33-33, which is negative and so not a prime power.

Hence the largest prime is p=47,p = 47, attained at x=7x = 7 with n=1n = 1.

Answer 47

Solution: PRMO 2018, Q15

Key idea

(2a−b)−(a−2b)=a+b(2a-b) - (a-2b) = a+b, so the three squares form a Pythagorean triple; and a triple can have 33 dividing the difference of its legs’ squares only when 33 divides both legs.

image

Write 2a−b=p22a - b = p^2, a−2b=q2a - 2b = q^2 and a+b=r2a + b = r^2. The first minus the second is the third: p2−q2=r2,that isq2+r2=p2,p^2 - q^2 = r^2, \qquad \text{that is} \qquad q^2 + r^2 = p^2, so (q,r,p)(q, r, p) is a Pythagorean triple. Solving the last two equations for aa and bb, b=r2−q23,a=2r2+q23,b = \frac{r^2 - q^2}{3}, \qquad a = \frac{2r^2 + q^2}{3}, so we need r>qr > q and 3∣r2−q23 \mid r^2 - q^2, and we are minimising bb.

Now the arithmetic that decides everything. Squares are 00 or 11 modulo 33, so if neither leg of the triple were a multiple of 33 we would have q2+r2≡2(mod3)q^2 + r^2 \equiv 2 \pmod 3, which is not a square. So at least one leg is divisible by 33. If exactly one is, then r2−q2≡±1(mod3)r^2 - q^2 \equiv \pm1 \pmod 3 and bb is not an integer. Hence 3∣qand3∣r.3 \mid q \quad\text{and}\quad 3 \mid r.

Write q=3Qq = 3Q, r=3Rr = 3R; then p=3Pp = 3P and (Q,R,P)(Q, R, P) is itself a Pythagorean triple, and b=9R2−9Q23=3(R2−Q2)=3(R−Q)(R+Q).b = \frac{9R^2 - 9Q^2}{3} = 3\left(R^2 - Q^2\right) = 3(R-Q)(R+Q). The smaller leg of a Pythagorean triple is at least 33: from Q2=P2−R2Q^2 = P^2 - R^2 with P≥R+1P \ge R + 1 we get Q2≥2R+1≥2Q+3Q^2 \ge 2R + 1 \ge 2Q + 3, that is (Q−3)(Q+1)≥0(Q-3)(Q+1) \ge 0. (It is not 00, since q=0q = 0 would make p=rp = r and the squares would not be distinct.) So Q≥3Q \ge 3, R≥Q+1≥4R \ge Q + 1 \ge 4 and R+Q≥7R + Q \ge 7, and R>QR > Q gives R−Q≥1R - Q \ge 1. Therefore b≥21b \ge 21, with equality only for (Q,R)=(3,4)(Q,R) = (3,4).

That case does occur: q=9q = 9, r=12r = 12, p=15p = 15 give b=21,a=2⋅144+813=123,b = 21, \qquad a = \frac{2 \cdot 144 + 81}{3} = 123, and then 2a−b=225=1522a - b = 225 = 15^2, a−2b=81=92a - 2b = 81 = 9^2, a+b=144=122a + b = 144 = 12^2, three distinct squares. So the smallest possible bb is 2121.

Answer 21

Solution: IOQM 2020, Q13

Key idea

A congruence modulo three disposes of every odd exponent at once, and for the even ones the expression is trapped just above a perfect square with no room to reach the next one.

Two values work, and finding them costs nothing: at n=2n = 2 we get ∣4+25−65∣=36=62|4 + 25 - 65| = 36 = 6^2, and at n=4n = 4 we get ∣16+625−65∣=576=242|16 + 625 - 65| = 576 = 24^2. The real content of the problem is showing that the list stops there, so that the answer is 2+4=62 + 4 = 6. We rule out the odd exponents and the even ones by quite different arguments.

No odd exponent works

The case n=1n = 1 gives 5858, which is not a square, so take nn odd with n≥3n \geq 3, where the expression is comfortably positive. Working modulo 33, where both 22 and 55 are congruent to −1-1 and 6565 is congruent to 22, 2n+5n−65≡(−1)n+(−1)n−2≡−1−1−2≡2(mod3)2^n + 5^n - 65 \equiv (-1)^n + (-1)^n - 2 \equiv -1 - 1 - 2 \equiv 2 \pmod 3 for odd nn. Every perfect square is congruent to 00 or 11 modulo 33, never to 22, so no odd exponent can succeed.

No even exponent beyond four works

Let nn be even with n≥8n \geq 8, so that 2n2^n comfortably exceeds 6565. The point is that 5n5^n is itself a perfect square when nn is even, namely (5n/2)2\bigl(5^{n/2}\bigr)^2, and our expression sits just above it: 2n+5n−65=(5n/2)2+(2n−65).2^n + 5^n - 65 = \bigl(5^{n/2}\bigr)^2 + \bigl(2^n - 65\bigr). For the total to be a square it would have to reach at least the next square up, which is (5n/2+1)2=(5n/2)2+2⋅5n/2+1\bigl(5^{n/2} + 1\bigr)^2 = \bigl(5^{n/2}\bigr)^2 + 2 \cdot 5^{n/2} + 1, and that would require 2n−65≥2⋅5n/2+1.2^n - 65 \geq 2 \cdot 5^{n/2} + 1. This is hopeless, because 5n/2=(5)n5^{n/2} = (\sqrt5)^n and 5>2\sqrt5 > 2, so 5n/25^{n/2} already exceeds 2n2^n on its own. The gap between consecutive squares up there is wider than the amount 2n−652^n - 65 we have to spend.

Only n=6n = 6 escapes both arguments, and it fails on inspection, since 64+15625−65=1562464 + 15625 - 65 = 15624, one short of 1252125^2. The solutions are n=2n = 2 and n=4n = 4, and their sum is 66.

Answer 6

Solution: IOQM 2020, Q29

Key idea

Strip out the common factor of aa and bb. The coprime part forces the difference p−qp-q to divide the common factor, and the whole sum then collapses to t(p2+pq−q2)t\left(p^2 + pq - q^2\right), a product of two independent quantities that is easy to push against the ceiling.

Write g=gcd⁡(a,b)g = \gcd(a,b) and a=gpa = gp, b=gqb = gq with p>q≥1p > q \geq 1 and gcd⁡(p,q)=1\gcd(p,q) = 1. Then c=aba−b=g2pqg(p−q)=g pqp−q.c = \frac{ab}{a-b} = \frac{g^2pq}{g(p-q)} = \frac{g\,pq}{p-q}. Because pp and qq are coprime, any common factor of p−qp-q with pp would also divide qq, and similarly the other way round, so p−qp-q is coprime to pqpq. For cc to be a whole number, then, p−qp-q must divide gg outright. Write g=(p−q)tg = (p-q)t.

Everything is now expressed in three free parameters: a=(p−q)tp,b=(p−q)tq,c=t pq,a = (p-q)tp, \qquad b = (p-q)tq, \qquad c = t\,pq, and the quantity we care about factors pleasantly, a+b+c=t[(p−q)(p+q)+pq]=t(p2+pq−q2).a+b+c = t\left[(p-q)(p+q) + pq\right] = t\left(p^2 + pq - q^2\right).

So we are choosing a coprime pair p>qp > q, computing v=p2+pq−q2v = p^2 + pq - q^2, and then taking tt as large as the ceiling permits. No comparison of the possibilities is needed, because the question asks for the largest value of a+b+ca+b+c not exceeding 9999, and the ceiling itself is reached: the pair (p,q)=(3,1)(p,q) = (3,1) gives v=11v = 11, and t=9t = 9 makes tv=99tv = 99 exactly.

Taking p=3p = 3, q=1q = 1 and t=9t = 9 gives a=54a = 54, b=18b = 18 and c=27c = 27, and indeed 54⋅1854−18=97236=27,54+18+27=99.\frac{54 \cdot 18}{54 - 18} = \frac{972}{36} = 27, \qquad 54 + 18 + 27 = 99.

Answer 99

Solution: IOQM 2023, Q11

Key idea

Multiplying by 1616 completes the square on the right, turning the condition into (4m−8n+5)(4m+8n−5)=231(4m - 8n + 5)(4m + 8n - 5) = 231, and 231231 has only a handful of factorisations.

The right-hand side is a quadratic in nn with an awkward middle term, so complete the square after clearing the fraction that would otherwise appear. Multiplying m2=4n2−5n+16m^2 = 4n^2 - 5n + 16 by 1616, 16m2=64n2−80n+256=(8n−5)2+231.16m^2 = 64n^2 - 80n + 256 = (8n-5)^2 + 231. Hence 16m2−(8n−5)2=23116m^2 - (8n-5)^2 = 231, which factorises as (4m−(8n−5))(4m+(8n−5))=231=3⋅7⋅11.\bigl(4m - (8n-5)\bigr)\bigl(4m + (8n-5)\bigr) = 231 = 3 \cdot 7 \cdot 11.

Write uu and vv for the two factors, so uv=231uv = 231, u+v=8mu + v = 8m and v−u=2(8n−5)v - u = 2(8n-5). Since mm is a positive integer, u+v>0u + v > 0, and as uv>0uv > 0 both are positive. The condition that really cuts the list down is 8∣u+v8 \mid u+v; and once that holds, v−uv - u must also be twice an odd number of the right shape for nn to be an integer.

Running through the eight ordered factorisations: (u,v)u+vm8n−5=(v−u)/2(1,231)23229115⇒n=15(3,77)801037 (not ≡3 mod 8)(7,33)40513 (no)(11,21)3245 (no)(21,11)324−5⇒n=0(33,7)405−13⇒n=−1(77,3)8010−37⇒n=−4(231,1)23229−115 (no)\begin{array}{c|c|c|c} (u,v) & u+v & m & 8n-5 = (v-u)/2 \\ \hline (1,231) & 232 & 29 & 115 \Rightarrow n = 15 \\ (3,77) & 80 & 10 & 37 \ \text{(not $\equiv 3 \bmod 8$)} \\ (7,33) & 40 & 5 & 13 \ \text{(no)} \\ (11,21) & 32 & 4 & 5 \ \text{(no)} \\ (21,11) & 32 & 4 & -5 \Rightarrow n = 0 \\ (33,7) & 40 & 5 & -13 \Rightarrow n = -1 \\ (77,3) & 80 & 10 & -37 \Rightarrow n = -4 \\ (231,1) & 232 & 29 & -115 \ \text{(no)} \end{array} The surviving pairs (m,n)(m,n) are (29,15)(29,15), (4,0)(4,0), (5,−1)(5,-1) and (10,−4)(10,-4), with ∣m−n∣|m-n| equal to 1414, 44, 66 and 1414. The maximum is ∣m−n∣=14.|m - n| = 14.

The problem’s insistence that nn may have any sign is doing real work: three of the four solutions have n≤0n\le0, and one of them attains the maximum.

Answer 14

Solution: IOQM 2024, Q25

Key idea

The two averages determine the size of MM outright, so the squares are seven in number and sum to 588588; then the largest is bounded by what the other six must leave behind.

Let MM contain kk squares along with 9292. From the two averages, sum of M=85(k+1),sum of the squares=84k,\text{sum of } M = 85(k+1), \qquad \text{sum of the squares} = 84k, and these differ by 9292: 85(k+1)−84k=92⟹k+85=92⟹k=7.85(k+1) - 84k = 92 \quad\Longrightarrow\quad k + 85 = 92 \quad\Longrightarrow\quad k = 7. So there are seven distinct positive squares with total 84⋅7=58884 \cdot 7 = 588.

To make one square as large as possible, make the other six as small as possible. The six smallest distinct positive squares are 1,4,9,16,25,361, 4, 9, 16, 25, 36, totalling 9191, so the largest square is at most 588−91=497588 - 91 = 497, giving N≤22N \le 22 since 222=48422^2 = 484 and 232=52923^2 = 529.

It remains to check that N=22N = 22 is attainable, that is, that six distinct squares different from 484484 sum to 588−484=104588 - 484 = 104. Starting from the minimum 9191 we need 1313 more, and replacing 3636 by 4949 does exactly that: 1+4+9+16+25+49=104.1 + 4 + 9 + 16 + 25 + 49 = 104. So M={1,4,9,16,25,49,484,92}M = \{1, 4, 9, 16, 25, 49, 484, 92\} works, and N=22N = 22.

Answer 22

Solution: IOQM 2024, Q26

Key idea

First show that n=⌊x⌋n=\lfloor x\rfloor is positive. On its window [n,n+1)[n,n+1) the left side increases, so n3n^3 must lie between the endpoint values. The left inequality factors, and successive differences settle the right.

Put n=⌊x⌋n = \lfloor x \rfloor and f(x)=15x2+15x+16f(x) = 15x^2 + 15x + 16, so the equation reads f(x)=n3f(x) = n^3 with xx in the window [n,n+1)[n, n+1). First, nn is positive: f(x)=15(x+12)2+494>0f(x) = 15\left(x + \tfrac12\right)^2 + \tfrac{49}{4} > 0, so n3>0n^3 > 0. On non-negative arguments ff is increasing, since for 0≤u<v0 \le u < v, f(v)−f(u)=15(v−u)(v+u+1)>0.f(v) - f(u) = 15(v-u)(v+u+1) > 0. So the window contains a solution exactly when f(n)≤n3<f(n+1),f(n) \le n^3 < f(n+1), and both halves can be settled exactly.

The left inequality

Here 15n2+15n+16≤n315n^2 + 15n + 16 \le n^3, that is n3−15n2−15n−16≥0n^3 - 15n^2 - 15n - 16 \ge 0. This cubic factors: n3−15n2−15n−16=(n−16)(n2+n+1),n^3 - 15n^2 - 15n - 16 = (n-16)\left(n^2 + n + 1\right), and the quadratic factor is positive for every nn, so the condition is exactly n≥16n \ge 16.

The right inequality

Here n3<15(n+1)2+15(n+1)+16=15n2+45n+46n^3 < 15(n+1)^2 + 15(n+1) + 16 = 15n^2 + 45n + 46, that is g(n)<0g(n) < 0 where g(n)=n3−15n2−45n−46.g(n) = n^3 - 15n^2 - 45n - 46. Now g(17)=−233g(17) = -233 and g(18)=116g(18) = 116, so 1717 passes and 1818 fails. And gg increases from there on, since g(n+1)−g(n)=3n2−27n−59,g(n+1) - g(n) = 3n^2 - 27n - 59, which is positive at n=18n = 18, where it equals 427427, and grows with nn. So no n≥18n \ge 18 passes.

Putting the two together, n=16n = 16 and n=17n = 17 are the only values that work, and the required sum is 16+17=3316 + 17 = 33. The case n=16n = 16 is worth seeing exactly: 60⋅4096−735=495260 \cdot 4096 - 735 = 495^2, so x=(495−15)/30=16x = (495-15)/30 = 16 lands on the left end of its own window.

Answer 33

Solution: IOQM 2024, Q30

Key idea

With AC=bAC = b the two conditions become ac=12bac = 12b and (a+c)2=b2+24b(a+c)^2 = b^2 + 24b, so b2+24bb^2+24b must be a perfect square, which factorises as (b+12−k)(b+12+k)=144(b+12-k)(b+12+k) = 144.

Let the legs be a=BCa = BC and c=ABc = AB and the hypotenuse b=ACb = AC. The altitude to the hypotenuse satisfies BD⋅AC=AB⋅BCBD \cdot AC = AB \cdot BC, so 12b=ac.12b = ac. Also a2+c2=b2a^2 + c^2 = b^2, and therefore (a+c)2=b2+2ac=b2+24b.(a+c)^2 = b^2 + 2ac = b^2 + 24b. The perimeter is a+c+ba + c + b, and bb is an integer, so the perimeter is an integer exactly when a+ca + c is, that is, exactly when b2+24bb^2 + 24b is a perfect square, say k2k^2.

Complete the square: (b+12)2−k2=144(b+12)^2 - k^2 = 144, so (b+12−k)(b+12+k)=144.(b + 12 - k)(b+12+k) = 144. Both factors have the same parity and their product is even, so both are even; writing them as 2s2s and 2t2t gives st=36st = 36 and b+12=s+tb + 12 = s + t, that is b=s+t−12,st=36.b = s + t - 12, \qquad st = 36.

One more constraint decides the matter. Since (a−c)2≥0(a-c)^2\ge0, we have 2ac≤a2+c2=b22ac\le a^2+c^2=b^2. Together with ac=12bac=12b, this gives 24b≤b2,b≥24,24b\le b^2,\qquad b\ge24, as b>0b>0. Running through the factorisations of 3636: (s,t)s+tb(1,36)3725(2,18)208(3,12)153(4,9)131(6,6)120\begin{array}{c|c|c} (s,t) & s+t & b \\ \hline (1,36) & 37 & 25 \\ (2,18) & 20 & 8 \\ (3,12) & 15 & 3 \\ (4,9) & 13 & 1 \\ (6,6) & 12 & 0 \end{array} Only b=25b = 25 clears the bound. A check confirms that it is genuine: a+c=625+600=35a + c = \sqrt{625+600} = 35 and ac=300ac = 300, so aa and cc are the roots of t2−35t+300t^2 - 35t + 300, namely 1515 and 2020. The familiar 1515-2020-2525 triangle has altitude 15⋅20/25=1215 \cdot 20 / 25 = 12 and perimeter 6060.

So the minimum possible length of ACAC is 2525.

Answer 25

Solution: IOQM 2025 Part SEP, Q28

Key idea

For a≥7a \ge 7 the number 4a+4a2+44^a + 4a^2+4 is squeezed strictly between the consecutive squares (2a)2(2^a)^2 and (2a+1)2(2^a+1)^2, so only small aa need testing.

Since b2=4a+4a2+4>(2a)2b^2 = 4^a + 4a^2 + 4 > (2^a)^2, we have b>2ab > 2^a. On the other side, (2a+1)2=4a+2a+1+1,(2^a+1)^2 = 4^a + 2^{a+1} + 1, so b<2a+1b < 2^a + 1 as soon as 4a2+4<2a+1+14a^2 + 4 < 2^{a+1}+1, that is 4a2+3<2a+1.4a^2 + 3 < 2^{a+1}. This holds for every a≥7a \ge 7, by induction. At a=7a = 7 it reads 199<256199 < 256. And if it holds at some a≥7a \ge 7, then 4(a+1)2+3<2(4a2+3)<2⋅2a+1=2a+2,4(a+1)^2 + 3 < 2\left(4a^2+3\right) < 2 \cdot 2^{a+1} = 2^{a+2}, where the first step is the inequality 4a2+8a+7<8a2+64a^2 + 8a + 7 < 8a^2 + 6, which rearranges to 4a2−8a−1>04a^2 - 8a - 1 > 0 and is true for every a≥3a \ge 3.

So for a≥7a \ge 7 there is no integer strictly between 2a2^a and 2a+12^a+1, and no solution exists.

That leaves a≤6a \le 6, which is a short check: a4a+4a2+4square?112no236623104no432418251128no64244no\begin{array}{c|c|c} a & 4^a+4a^2+4 & \text{square?} \\ \hline 1 & 12 & \text{no} \\ 2 & 36 & 6^2 \\ 3 & 104 & \text{no} \\ 4 & 324 & 18^2 \\ 5 & 1128 & \text{no} \\ 6 & 4244 & \text{no} \end{array} The solutions are (a,b)=(2,6)(a,b) = (2,6) and (4,18)(4,18), and the larger value of a+ba+b is 4+18=22.4 + 18 = 22.

Answer 22

Solution: IOQM 2026, Q15

Key idea

Since a2+b2a^2 + b^2 is more than 20262026, a+ba + b is at least 4747. And a2+b2a^2 + b^2 has the same parity as a+ba + b, which rules out every total below 5151.

Write s=a+bs = a + b and t=c+dt = c + d, so t≥2t \ge 2 and the total is s+ts + t.

First, s≥47s \ge 47. Since (a−1)(b−1)≥0(a - 1)(b - 1) \ge 0, we have ab≥s−1ab \ge s - 1, and so a2+b2=s2−2ab≤s2−2s+2=(s−1)2+1.a^2 + b^2 = s^2 - 2ab \le s^2 - 2s + 2 = (s - 1)^2 + 1. If s≤46s \le 46 this is at most 452+1=202645^2 + 1 = 2026, but a2+b2=2026+cd2a^2 + b^2 = 2026 + cd^2 is at least 20272027.

Then parity. A square has the same parity as the number squared, so a2+b2a^2 + b^2 has the parity of ss, while 2026+cd22026 + cd^2 has the parity of cdcd. A total of at most 5050 with s≥47s \ge 47 and t≥2t \ge 2 leaves two cases.

  • s=47s = 47 and t≤3t \le 3. Here ss is odd, so cdcd is odd, so cc and dd are both odd and t=2t = 2, with c=d=1c = d = 1. Then a2+(47−a)2=2027a^2 + (47 - a)^2 = 2027, which simplifies to a2−47a+91=0a^2 - 47a + 91 = 0. Its discriminant is 472−364=184547^2 - 364 = 1845, which lies strictly between 422=176442^2 = 1764 and 432=184943^2 = 1849, so there is no integer aa.

  • s=48s = 48 and t=2t = 2. Then c=d=1c = d = 1 and cdcd is odd while ss is even, which parity forbids.

So the total is at least 5151, and it is reached: a=45a = 45, b=2b = 2, c=3c = 3, d=1d = 1 gives 2025+4−3=20262025 + 4 - 3 = 2026 and a+b+c+d=51a + b + c + d = 51.

Answer 51

Solution: IOQM 2026, Q28

Key idea

Both tenth terms are fixed multiples of the starting values, b10=512 b1b_{10} = 512\,b_1 and a10=21a1+34a2a_{10} = 21a_1 + 34a_2. The bound leaves b1=1,2,3b_1 = 1, 2, 3, and in each case a2+b1a_2 + b_1 has to be a multiple of 2121.

Doubling nine times, b10=512 b1b_{10} = 512\,b_1, and 512 b1<2026512\,b_1 < 2026 leaves b1=1,2,3b_1 = 1, 2, 3.

Running the rule for aa forward from a1a_1 and a2a_2, nan3a1+a24a1+2a252a1+3a263a1+5a275a1+8a288a1+13a2913a1+21a21021a1+34a2\begin{array}{c|l} n&a_n\\\hline 3&a_1+a_2\\ 4&a_1+2a_2\\ 5&2a_1+3a_2\\ 6&3a_1+5a_2\\ 7&5a_1+8a_2\\ 8&8a_1+13a_2\\ 9&13a_1+21a_2\\ 10&21a_1+34a_2 \end{array} the coefficients being consecutive Fibonacci numbers. The sequence increases exactly when a1<a2a_1 < a_2, since every later term is a sum of two earlier positive ones.

Write k=b1k = b_1, so the equation is 21a1+34a2=512k21a_1 + 34a_2 = 512k. Since 546=26×21546 = 26 \times 21, 34a2−512k=34(a2+k)−546k34a_2 - 512k = 34(a_2 + k) - 546k is a multiple of 2121 exactly when 34(a2+k)34(a_2 + k) is, and as 3434 and 2121 share no factor, a2+ka_2 + k must be a multiple of 2121. Also 34a2<512k34a_2 < 512k.

  • k=1k = 1: a2≤15a_2 \le 15, and a2+1a_2 + 1 is never a multiple of 2121. No solution.

  • k=2k = 2: a2≤30a_2 \le 30 and a2+2a_2 + 2 a multiple of 2121 give a2=19a_2 = 19, then a1=18a_1 = 18. Since 18<1918 < 19 this works, and a1+b1=20a_1 + b_1 = 20.

  • k=3k = 3: a2≤45a_2 \le 45 gives a2=18a_2 = 18 or 3939. The first needs a1=44a_1 = 44, which is not less than 1818; the second gives a1=10a_1 = 10, which works, and a1+b1=13a_1 + b_1 = 13.

The possible values are 2020 and 1313, and their sum is 3333.

Answer 33

Solution: IOQM 2025 Part SEP, Q7

Key idea

Since a\sqrt a is irrational, matching the irrational parts forces y=0y = 0, and then the equation says aa is a triangular number.

Squaring the given equation, x−x+a=a−2ya+y2,x - \sqrt{x+a} = a - 2y\sqrt a + y^2, that is, x−a−y2=x+a−2ya.x - a - y^2 = \sqrt{x+a} - 2y\sqrt a. The left-hand side is an integer, so x+a=m+2ya\sqrt{x+a} = m + 2y\sqrt a for the integer m=x−a−y2m = x - a - y^2. Squaring again, x+a=m2+4y2a+4mya,x + a = m^2 + 4y^2a + 4my\sqrt a, and since aa is not a perfect square, a\sqrt a is irrational, so 4my=04my = 0.

If m=0m = 0 then x+a=2ya\sqrt{x+a} = 2y\sqrt a, hence x=(4y2−1)ax = (4y^2-1)a and m=x−a−y2=(4y2−2)a−y2=0m = x - a - y^2 = (4y^2 - 2)a - y^2 = 0, giving a=y24y2−2<1a = \dfrac{y^2}{4y^2-2} < 1, which no positive integer aa satisfies. So y=0y = 0.

With y=0y = 0 the original equation reads x−x+a=ax - \sqrt{x+a} = a, so x+a=x−a\sqrt{x+a} = x - a. Setting t=x−a≥0t = x - a \ge 0 and squaring, x+a=t2x + a = t^2, and subtracting the two expressions for xx, t2−2a=t,a=t(t−1)2.t^2 - 2a = t, \qquad a = \frac{t(t-1)}{2}. So aa is a triangular number. Conversely, every triangular number a=12t(t−1)a = \tfrac12 t(t-1) gives a solution, taking y=0y = 0 and x=t2−ax = t^2 - a; the hypothesis that aa is not a perfect square then keeps only those triangular numbers that are not squares, which rules out 11 and 3636 among the small ones.

The largest triangular number below 100100 is 14⋅132=91\tfrac{14 \cdot 13}{2} = 91, and 9191 is not a perfect square, as required. (Here t=14t = 14 and x=196−91=105x = 196 - 91 = 105.)

Answer 91

Report an error on this page

Reports are stored by Netlify. See the privacy note.