For how many pairs of positive integers (x,y) is x+3y=100?
Problem 2
What is the number of integers in the set {0,…,20} which can be expressed as the sum of two square integers?
Problem 3
The letters R, M, and O represent whole numbers. If R×M×O=240, R×O+M=46 and R+M×O=64, what is the value of R+M+O?
Problem 4
Positive integers a and b are such that a+b=a/b+b/a. What is the value of a2+b2?
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: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 a, b, c satisfy a+b−c=1 and a2+b2−c2=−1. What is the sum of all possible values of a2+b2+c2?
Problem 8
The age of a person (in years) in 2025 is a perfect square. His age (in years) was also a perfect square in 2012. His age (in years) will be a perfect cube m years after 2025. Determine the smallest value of m.
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π where k is a positive integer, what is the smallest possible value of k?
Problem 10
Find the number of 2-digit positive integers n such that n=26+(a×b), where a and b are the two digits of n.
Problem 11
Let Sn=n2+20n+12, n a positive integer. What is the sum of all possible values of n for which Sn is a perfect square?
Problem 12
Let Arthur and Beatrice together have n marbles, where n>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 n 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 m be the smallest odd positive integer for which 1+2+⋯+m is a square of an integer and let n be the smallest even positive integer for which 1+2+⋯+n is a square of an integer. What is the value of m+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/7-th of the total amount of milk and 2/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/q be closest to but not equal to 22/7 among all rational numbers with denominator <100. What is the value of p−3q?
Problem 18
A pen costs £13 and a note book costs £17. A school spends exactly £10000 in the year 2017-18 to buy x pens and y note books such that x and y are as close as possible (i.e., ∣x−y∣ is minimum). Next year, in 2018-19, the school spends a little more than £10000 and buys y pens and x note books. How much more did the school pay?
Problem 19
Starting with a positive integer M written on the board, Alice plays the following game: in each move, if x is the number on the board, she replaces it with 3x+2. Similarly, starting with a positive integer N written on the board, Bob plays the following game: in each move, if x is the number on the board, he replaces it with 2x+27. Given that Alice and Bob reach the same number after playing 4 moves each, find the smallest value of M+N.
Problem 20
Let m be the smallest positive integer such that m2+(m+1)2+⋯+(m+10)2 is the square of a positive integer n. Find m+n.
Problem 21
Let a,b be positive integers satisfying a3−b3−ab=25. Find the largest possible value of a2+b3.
Problem 22
Consider a string of n1’s. We wish to place some + signs in between so that the sum is 1000. For instance, if n=190, one may put + signs so as to get 11 ninety times and 1 ten times, and get the sum 1000. If a is the number of positive integers n for which it is possible to place + signs so as to get the sum 1000, then find the sum of the digits of a.
Problem 23
Let α and β be positive integers such that 3716<βα<167. Find the smallest possible value of β.
Problem 24
Let x,y be positive integers such that x4=(x−1)(y3−23)−1. Find the maximum possible value of x+y.
Problem 25
Three positive integers a,b,c with a>c satisfy the following equations: ac+b+c=bc+a+66,a+b+c=32. Find the value of a.
Problem 26
Consider a fraction ba=43, where a,b are positive integers with gcd(a,b)=1 and b≤15. If this fraction is chosen closest to 43 amongst all such fractions, then what is the value of a+b?
Problem 27
How many integer pairs (x,y) satisfy x2+4y2−2xy−2x−4y−8=0?
Problem 28
Suppose an integer x, a natural number n and a prime number p satisfy the equation 7x2−44x+12=pn. Find the largest value of p.
Problem 29
Let a and b be natural numbers such that 2a−b,a−2b and a+b are all distinct squares. What is the smallest possible value of b?
Problem 30
Find the sum of all positive integers n for which ∣2n+5n−65∣ is a perfect square.
Problem 31
Positive integers a,b,c satisfy a−bab=c. What is the largest possible value of a+b+c not exceeding 99?
Problem 32
A positive integer m has the property that m2 is expressible in the form 4n2−5n+16 where n is an integer (of any sign). Find the maximum possible value of ∣m−n∣.
Problem 33
A finite set M of positive integers consists of distinct perfect squares and the number 92. The average of the numbers in M is 85. If we remove 92 from M, the average drops to 84. If N2 is the largest possible square in M, what is the value of N?
Problem 34
The sum of ⌊x⌋ for all real numbers x satisfying the equation 16+15x+15x2=⌊x⌋3 is:
Problem 35
Let ABC be a right-angled triangle with ∠B=90∘. Let the length of the altitude BD be equal to 12. What is the minimum possible length of AC, given that AC and the perimeter of triangle ABC are integers?
Not to scale.
Problem 36
If a and b are positive integers satisfying 4a+4a2+4=b2, what is the maximum possible value of a+b.
Problem 37
Let a,b,c,d be positive integers such that a2+b2−cd2=2026. Find the minimum possible value of a+b+c+d.
Problem 38
Let a1,a2,… and b1,b2,… be strictly increasing sequences of positive integers such that
(a) an+1=an+an−1 for n≥2
(b) bn=2bn−1 for all n≥2
(c) a10=b10<2026.
Find the sum of all possible values of a1+b1.
Problem 39
Assume a is a positive integer which is not a perfect square. Let x,y be non-negative integers such that x−x+a=a−y. What is the largest possible value of a such that a<100?
Solutions
Solution: PRMO 2012, Q3
Key idea
y is free up to the point where x=100−3y stops being positive.
For each positive integer y the value x=100−3y is determined, and it is positive exactly when 3y≤99, that is y≤33. Every such y gives a valid pair, so there are 33 pairs, from (97,1) to (1,33).
Answer 33
Solution: IOQM 2026, Q10
Key idea
Only 0, 1, 4, 9 and 16 are squares small enough to matter, and listing their sums up to 20 is quicker than any theory.
Zero is a square, 0=02, so a sum of two squares may use it. The squares up to 20 are 0,1,4,9,16, and their sums in pairs, repeats allowed, that do not pass 20 are 0=0+0,5=1+4,13=4+9,20=4+16.1=0+1,8=4+4,16=0+16,2=1+1,9=0+9,17=1+16,4=0+4,10=1+9,18=9+9, The pairs 9+16 and 16+16 pass 20, so the list is complete, and it holds 13 integers.
Answer 13
Solution: PRMO 2012, Q4
Key idea
Treating RO as one unknown, the first two equations give RO+RO240=46, a quadratic with roots 40 and 6.
Write p=R×O. The first equation says Mp=240, so M=240/p, and substituting into the second, p+p240=46,p2−46p+240=0,p=40 or 6.
Take the cases in turn. If p=40 then M=6, and the third equation reads R+6O=64 with RO=40, so O40+6O=64, that is 3O2−32O+20=0, whose roots are 10 and 32. Only O=10 is a whole number, giving R=4.
If p=6 then M=40 and R+40O=64 with RO=6, leading to 20O2−32O+3=0, whose roots 23 and 101 are both fractions.
So (R,M,O)=(4,6,10), which satisfies all three equations, and 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 1.
Multiplying a+b=ba+ab through by ab gives ab(a+b)=a2+b2. Now write d=gcd(a,b) and a=dx, b=dy with gcd(x,y)=1. Substituting and cancelling d2 from both sides, dxy(x+y)=x2+y2. This is where coprimality does the work. The number x divides the left-hand side, so it divides x2+y2, and since it certainly divides x2 it must divide y2. But x and y share no factor, so x=1. The same argument on y gives y=1.
With x=y=1 the equation reads 2d=2, so d=1 and therefore a=b=1. A quick check confirms it: 1+1=11+11. Hence a2+b2=2.
Answer 2
Solution: PRMO 2017, Q8
Key idea
Solve 11p+13q=1000 modulo 13; the general solution is a single arithmetic progression, and counting is a matter of where it stays non-negative.
Let p be the number of pens and q the number of notebooks, so 11p+13q=1000 with p,q≥0.
Work modulo 13. Since 1000=76×13+12, the equation reads 11p≡12, and 11≡−2, so −2p≡12, that is p≡−6≡7(mod13). Writing p=7+13t, q=131000−11(7+13t)=13923−143t=71−11t.
Both are non-negative exactly when 0≤t≤1171=6.45…, that is t=0,1,…,6. That is 7 ways, running from (p,q)=(7,71) to (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)2, and its two roots are separated by the requirement that k be a whole number.
Let the numbers of boys and girls be 4k and 3k. On the day in question the numbers present are 4k−8 boys and 3k−14 girls, and we are told 4k−8=(3k−14)2. Expanding, 9k2−84k+196=4k−8, that is 9k2−88k+204=0. The discriminant is 882−4⋅9⋅204=7744−7344=400, so k=1888±20,k=6 or k=1868. Only k=6 is a whole number, so the class has 24 boys and 18 girls, a total of 42.
The answer checks out: 24−8=16 boys and 18−14=4 girls were present, and 16=42.
Answer 42
Solution: PRMO 2018, Q6
Key idea
Substituting c=a+b−1 into the second equation collapses it to (a−1)(b−1)=1, which has exactly two integer solutions.
From the first equation, c=a+b−1. Substituting into the second, a2+b2−(a+b−1)2=−1. Expanding (a+b−1)2=a2+b2+1+2ab−2a−2b and cancelling, −2ab+2a+2b−1=−1,that isa+b=ab. Rearranged, ab−a−b+1=1, so (a−1)(b−1)=1.
Over the integers the only factorisations of 1 are 1×1 and (−1)×(−1), giving (a,b)=(2,2) or (a,b)=(0,0). The corresponding c are 3 and −1, and both really do satisfy the original pair: 4+4−9=−1 and 0+0−1=−1.
The two values of a2+b2+c2 are 4+4+9=17 and 0+0+1=1, and their sum is 17+1=18.
Answer 18
Solution: IOQM 2025 Part SEP, Q7
Key idea
Two perfect squares differing by 13 must be 36 and 49, since 13 is prime and p2−q2=(p−q)(p+q).
The two ages differ by 2025−2012=13, so we need squares with p2−q2=13,(p−q)(p+q)=13. As 13 is prime and p+q is the larger factor, p−q=1 and p+q=13, giving p=7 and q=6. So the person was 36 in 2012 and is 49 in 2025.
The next perfect cube at or beyond 49 is 64=43, reached 64−49=15 years after 2025. So m=15.
Answer 15
Solution: IOQM 2025 Part SEP, Q7
Key idea
Setting surface area equal to volume and cancelling πr gives rh−2r−2h=0, which factors as (r−2)(h−2)=4.
For a closed cylinder of radius r and height h, 2πr2+2πrh=πr2h. Dividing by πr, which is positive, gives 2r+2h=rh, so rh−2r−2h+4=4,(r−2)(h−2)=4.
Both r and h are positive integers, and neither r−2 nor h−2 can be negative here, since a negative factor would force the other to be negative too and then r,h≤1, which fails the equation. So the factorisations of 4 give (r,h)=(3,6),(4,4),(6,3), with volumes πr2h equal to 54π, 64π and 108π.
The smallest value of k is 54.
Answer 54
Solution: IOQM 2026, Q6
Key idea
With n=10a+b, the condition rearranges to (a−1)(10−b)=16, and the ranges of the digits leave only three ways to split 16.
Write n=10a+b, where a runs from 1 to 9 and b from 0 to 9. The condition is 10a+b=26+ab. Gathering everything that involves a on one side, 10a−ab=26−b,a(10−b)=26−b. The right-hand side is (10−b)+16, so subtracting 10−b from both sides gives (a−1)(10−b)=16.
Now a−1 lies between 0 and 8, and 10−b between 1 and 10. Of the ways to write 16 as a product of two positive integers, 1×16 and 16×1 each have a factor out of range, which leaves three: 2×8,4×4,8×2, giving (a,b)=(3,2),(5,6),(9,8). Each checks: 32=26+6, 56=26+30 and 98=26+72. There are 3 such numbers.
Answer 3
Solution: PRMO 2012, Q5
Key idea
Completing the square turns Sn into (n+10)2−88, so a square value means a difference of two squares equal to 88.
Since n2+20n+12=(n+10)2−88, asking for Sn=k2 is asking for (n+10)2−k2=88,(n+10−k)(n+10+k)=88.
The two factors have the same parity, since they differ by 2k, and their product 88 is even, so both are even. Writing 88=2×44=4×22 (the split 8×11 mixes parities), n+10=22+44=23⟹n=13,n+10=24+22=13⟹n=3. Both work: S13=441=212 and S3=81=92.
The sum of all possible n is 13+3=16.
Answer 16
Solution: PRMO 2013, Q7
Key idea
The two transfers require 3∣2a−b and 4∣3b−a. Expressing these quantities in terms of the total n=a+b turns them into divisibility conditions on n.
Let Arthur have a marbles and Beatrice b, with a+b=n.
Arthur’s statement is that for some whole number x≥1, giving away x leaves b+x=2(a−x), that is 3x=2a−b. So 2a−b must be a positive multiple of 3, at least 3.
Beatrice’s is that for some y≥1, a+y=3(b−y), that is 4y=3b−a, so 3b−a is a positive multiple of 4, at least 4.
Now write both in terms of n. Since b=n−a, 2a−b=3a−n,3b−a=4b−n. The first is a multiple of 3 exactly when 3∣n, and the second is a multiple of 4 exactly when 4∣n. So 12∣n.
And n=12 is achievable: take a=5 and b=7. Then 2a−b=3, so Arthur gives one marble and Beatrice is left with 8 against Arthur’s 4; and 3b−a=16, so Beatrice gives four marbles and Arthur has 9 against Beatrice’s 3. Both statements hold, so n=12.
Answer 12
Solution: PRMO 2013, Q10
Key idea
The condition rearranges to c=a+b−1ab, and asking c to be the largest forces a=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=21, b=1 and c=1 satisfies the condition, since 1+21=23=1⋅23, and the sum is 25 rather than 3. 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≤c, positive integers, with c the largest. Carol should have computed c+ab and instead computed c(a+b), and the two agreed: c+ab=c(a+b). Solving for c, c(1−a−b)=−ab,c=a+b−1ab.
Now use the fact that c is the largest, so c≥b: a+b−1ab≥b⟹a≥a+b−1⟹b≤1. So b=1, and since a≤b we may as well take a≤1 too, giving a=1. Then c=1+1−11=1.
The three numbers are 1, 1, 1, and indeed 1+1×1=2=1×(1+1). Their sum is 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=21k(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=12, so m=1.
For the smallest even index, take the even values in turn: T2=3,T4=10,T6=21,T8=36=62. None of the first three is a square, and the fourth is, so n=8. Hence m+n=1+8=9.
A word on m=1, which surprises some readers. The sum 1+2+⋯+m with m=1 is just 1, and 1 is a square, so the condition is met. If one insists on at least two terms, the smallest odd index becomes 49 and the answer would be 57; the question as printed does not say that, so the answer is 9.
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 n people, so the family drank 8n ounces in all. Write M for the total milk and C for the total coffee, so M+C=8n.
Megan drank eight ounces, made of 71 of the milk and 172 of the coffee: 7M+172C=8,that is17M+14C=952.
Substituting M=8n−C gives 136n−3C=952, so C=3136n−952,M=8n−C=3952−112n.
Both totals are positive, since every cup contained some of each: C>0⟹n>7,M>0⟹n<8.5. The only integer between is n=8. Then C=3136 and M=356 ounces, which do sum to 64=8×8.
That n=8 is forced does not by itself show that eight people can actually be served, so here is a distribution that works. Megan takes 71 of the milk and 172 of the coffee, namely 38 ounces of milk and 316 of coffee, which is eight ounces. That leaves 16 ounces of milk and 40 of coffee for the other seven, so give each of them 716 of milk and 740 of coffee, again eight ounces. Every cup contains some of each, as the question requires.
The fractions 71 and 172 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 12 is a leg then 144=(c−b)(c+b), and to make the perimeter large we want c+b large, which means taking the factorisation as lopsided as parity allows.
There are two cases, and one of them is quickly dismissed. If 12 were the hypotenuse then both legs are less than 12 and the perimeter is under 36, which will turn out to be far from the best. So take 12 as a leg, with the other leg b and hypotenuse c, both positive integers. Then b2+144=c2, that is (c−b)(c+b)=144. The perimeter is 12+b+c, so we want b+c as large as possible. Writing c−b=u and c+b=v with uv=144, we want v as large as possible, hence u as small as possible.
Two constraints bite. First, u and v have the same parity, because u+v=2c is even, and since their product 144 is even they must both be even. Second, v>u, so that b>0. The smallest even value of u is 2, giving v=72, and then c=2u+v=37,b=2v−u=35. A check confirms the triangle: 122+352=144+1225=1369=372. The perimeter is 12+35+37=84.
Why does u=1 fail, one might reasonably ask, since it would give the larger v=144. It fails because then c=2145 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/q and 22/7 is ∣7p−22q∣/(7q), a fraction whose numerator is a positive integer, so the gap is smallest when the numerator is 1 and q is as large as allowed.
For any fraction p/q with q<100, qp−722=7q∣7p−22q∣. The numerator ∣7p−22q∣ is a non-negative integer, and it is zero only when p/q equals 22/7, which is excluded. So it is at least 1, and qp−722≥7q1≥7×991=6931.
Equality needs both q=99 and ∣7p−22q∣=1, so 7p=22×99±1=2178±1. Of the two, 2177=7×311 is divisible by 7 while 2179 is not. Hence the unique closest fraction is qp=99311, and it does sit at distance exactly 1/693, so the bound is attained. Finally 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/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), so the whole question is how close x and y can be, and the general solution of the linear equation answers that in one step.
First solve 13x+17y=10000 in non-negative integers. Working modulo 17, and using 10000=17×588+4, 13x≡4(mod17). Since 13≡−4, this reads −4x≡4, that is x≡−1≡16(mod17). So x=16+17t,y=1710000−13(16+17t)=576−13t, and both are non-negative exactly for 0≤t≤44.
Now measure the gap: x−y=(16+17t)−(576−13t)=30t−560. This vanishes at t=1832, so the integer candidates are t=18, giving x−y=−20, and t=19, giving x−y=10. The minimum of ∣x−y∣ is therefore 10, attained at t=19: x=339,y=329,13×339+17×329=10000.
The following year the school buys y pens and x notebooks, so it pays 13y+17x. The difference is (13y+17x)−(13x+17y)=4(x−y)=4×10=40. The school paid £40 more, and one may check it directly: 13×329+17×339=4277+5763=10040.
The identity 4(x−y) is the whole reason the question insisted that x and y 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).
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: move1234Alice3M+29M+827M+2681M+80Bob2N+274N+818N+18916N+405 Setting them equal, 81M+80=16N+405,that is81M−16N=325.
We want the smallest M+N in positive integers, so read the equation modulo 16, where the awkward coefficient becomes harmless: 81≡1, and 325=20⋅16+5, so M≡5(mod16). So M=5+16t for some integer t≥0, and substituting back gives 16N=81(5+16t)−325=80+1296t, that is N=5+81t. Hence M+N=10+97t, which is smallest at t=0, where M=N=5 and both are positive. The minimum is M+N=10.
Answer 10
Solution: IOQM 2022, Q5
Key idea
Centre the eleven squares on m+5: the linear terms cancel in pairs. The remaining factor 11 forces 11∣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 and let u=m+5. The cross terms cancel in pairs and k=−5∑5(u+k)2=11u2+2uk=−5∑5k+k=−5∑5k2=11u2+110.
So we need 11(u2+10)=n2. Since 11 is prime and divides n2, it divides n; writing n=11t and cancelling gives u2+10=11t2,that isu2−11t2=−10.
Now hunt for the smallest solution with u>5, since m=u−5 must be positive. Testing t in turn, 11t2−10 must be a perfect square: t=1 gives 1, so u=1 and m=−4, which is not positive; t=2,3,4,5,6 give 34,89,166,265,386, none of them squares; and t=7 gives 11⋅49−10=529=232.
The first admissible t is also the best one, because the quantity we are minimising is m+n=(u−5)+11t, and u=11t2−10 increases with t, so both terms do.
So u=23, hence m=18, and n=11t=77. Checking, the eleven squares from 182 to 282 do sum to 5929=772. Therefore m+n=18+77=95.
Answer 95
Solution: IOQM 2022, Q6
Key idea
Bound the gap a−b. If it is two or more the left side races past 25, so a=b+1 and the cubic collapses to a quadratic.
Since a3−b3=25+ab>0 we know a>b, so the gap a−b is a positive integer, and the useful question is how large it can be.
For fixed b, increasing a by 1 changes a3−b3−ab by 3a2+3a+1−b, positive when a>b. Thus if a≥b+2, its smallest possible value occurs at a=b+2, and a3−b3−ab≥(b+2)3−b3−b(b+2)=5b2+10b+8, which already exceeds 25 for every b≥2. That leaves only b=1 with a≥3, where the condition reads a3−1−a=25, so a3−a=26; but 33−3=24 and 43−4=60, so there is no solution. Hence a=b+1.
Substituting a=b+1 turns the cubic into a quadratic: (b+1)3−b3−b(b+1)=3b2+3b+1−b2−b=2b2+2b+1=25, so b2+b−12=0 and (b+4)(b−3)=0. Only b=3 is positive, giving a=4, and indeed 64−27−12=25.
The solution is unique, so the largest value of a2+b3 is the only one: 16+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+12c can take.
Placing plus signs in a string of 1s produces a sum of repunits, and since 1111>1000 only 1, 11 and 111 can appear. Suppose we use α ones, β elevens and γ one hundred and elevens, so that α+11β+111γ=1000,n=α+2β+3γ.
Eliminate α using the first equation. Substituting α=1000−11β−111γ, n=1000−9β−108γ=1000−9(β+12γ). So n is determined by the single quantity w=β+12γ, and counting the achievable n is the same as counting the achievable w.
The constraint is α≥0, that is 11β+111γ≤1000. For each γ from 0 to 9 this allows β from 0 up to ⌊111000−111γ⌋, and the resulting w fills the interval from 12γ to 12γ+⌊111000−111γ⌋. Their endpoints are all visible in one table: γminwmaxw0090112922249433696448985601006721027841048961069108108 Each interval through γ=8 starts before the preceding one ends, so their union contains every integer from 0 to 106. The final case γ=9 forces β=0 and contributes the isolated value w=108.
So w takes 107+1=108 values, and 107 is the one gap. Hence a=108, and the sum of its digits is 1+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 1, and combining the two with the right weights produces 3β as a sum of multiples of 16 and 37.
Since α and β are positive integers, the inequality 3716<βα says 37α−16β>0, and an integer greater than zero is at least 1. The same applies on the other side. So there are positive integers u and v with 37α−16β=u≥1,7β−16α=v≥1.
Now eliminate α. Multiplying the first by 16 and the second by 37 and adding, 16u+37v=(592α−256β)+(259β−592α)=3β. That single line is the whole problem: 3β must be expressible as 16u+37v with u and v positive integers.
Two constraints then pin β down. First, reading the equation modulo 3 and using 16≡1 and 37≡1, we get u+v≡0(mod3). Second, we want 16u+37v as small as possible. Take v=1: then u+1 must be a multiple of 3, so u≥2, and the smallest value is 16⋅2+37=69, giving β=23. Take v≥2 instead: then 16u+37v≥16+74=90>69. So no smaller β is possible.
It remains to confirm that β=23 really occurs. From u=2 and v=1 we get 37α=16⋅23+2=370, so α=10, and indeed 3716<2310<167, both by cross-multiplication: 16⋅23=368<370=10⋅37, and 10⋅16=160<161=7⋅23.
Answer 23
Solution: IOQM 2023, Q4
Key idea
Rearranged, the equation says x−1 divides x4+1, and since x≡1 modulo x−1 that forces x−1 to divide 2.
Move the −1 across to get x4+1=(x−1)(y3−23), The case x=1 would give 1=−1 in the original equation, so x>1. Hence x−1 divides x4+1. This is the kind of divisibility that collapses immediately, because modulo x−1 we have x≡1, hence x4+1≡14+1=2(modx−1). Therefore x−1 divides 2, leaving only x=2 and x=3.
Each candidate is now a single line of arithmetic. If x=2 then 17=y3−23, so y3=40, and 40 is not a cube. If x=3 then 82=2(y3−23), so y3=64 and y=4, which is a genuine solution.
Only one pair survives, so the maximum of x+y is 3+4=7.
Answer 7
Solution: IOQM 2024, Q13
Key idea
Rearranged, the first equation factorises as (c−1)(a−b+1)=65, and 65 has few factorisations.
Move everything to one side of ac+b+c=bc+a+66: ac−bc−a+b+c=66. The first four terms group as 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, and therefore (c−1)(a−b+1)=65. The step of writing c as (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⋅13, the factor c−1 is one of 1,5,13,65. Combine each case with a+b+c=32: c−1151365c261466a−b641240(a,b)a+b=30⇒b=−17, rejecteda+b=26⇒(19,7)a+b=18⇒(11,7)c>32, rejected Two candidates survive the positivity requirement, and the condition a>c decides between them: (a,b,c)=(11,7,14) has a<c, while (19,7,6) has a>c as required. A check confirms it: 19⋅6+7+6=127 and 7⋅6+19+66=127.
So a=19.
Answer 19
Solution: IOQM 2025 Part SEP, Q7
Key idea
The distance from 43 is 4b∣3b−4a∣, whose numerator is a positive integer, so the fraction to beat is the one with ∣3b−4a∣=1 and b as large as allowed.
For any fraction ba=43, 43−ba=4b∣3b−4a∣. The numerator is a positive integer, so the distance is at least 4b1≥601 because b≤15.
Can 601 be attained? That needs b=15 and ∣3⋅15−4a∣=1, that is 4a=44 or 46. The first gives a=11, and gcd(11,15)=1, so 1511is at distance6045−44=601.
Nothing else comes closer, since any other fraction has b≤15 and numerator at least 1, and equality in 4b1=601 forces b=15. So a+b=11+15=26.
Answer 26
Solution: PRMO 2012, Q19
Key idea
Read it as a quadratic in x: the discriminant is −12(y−3)(y+1), which is non-negative only for −1≤y≤3.
Collect the terms in x: x2−(2y+2)x+(4y2−4y−8)=0. Its discriminant is (2y+2)2−4(4y2−4y−8)=−12y2+24y+36, which factorises as −12(y−3)(y+1).
For a real solution this must be non-negative, so −1≤y≤3, and for an integer solution it must also be a perfect square. Checking the five values:
y=−1: discriminant 0, giving x=0.
y=0: discriminant 36, giving x=4 or x=−2.
y=1: discriminant 48, not a square.
y=2: discriminant 36, giving x=6 or x=0.
y=3: discriminant 0, giving x=4.
That is six pairs in all: (0,−1), (4,0), (−2,0), (6,2), (0,2) and (4,3).
Answer 6
Solution: PRMO 2017, Q23
Key idea
The quadratic factorises as (7x−2)(x−6), and a prime dividing both factors would divide 40, so a large prime forces one factor to be ±1.
The left-hand side factorises: 7x2−44x+12=(7x−2)(x−6). So we need (7x−2)(x−6)=pn. If the convention in force allows n=0, that case dies at once: the product would be 1, forcing both factors to be 1 or both to be −1, and 7x−2 is neither for any integer x. So n≥1 and the right-hand side is a genuine power of a prime.
Each factor is therefore ± a power of p, and the two signs agree since the product is positive. Suppose both factors are divisible by p. Then p divides (7x−2)−7(x−6)=40, so p is 2 or 5. Those are small, so a large p requires one factor to have no p in it at all, that is to be ±1.
Check the possibilities. The factor 7x−2 is ≡5(mod7), so it is never ±1. That leaves x−6=±1:
x=7: then x−6=1 and 7x−2=47, so pn=47, a prime.
x=5: then x−6=−1 and 7x−2=33, giving −33, which is negative and so not a prime power.
Hence the largest prime is p=47, attained at x=7 with n=1.
Answer 47
Solution: PRMO 2018, Q15
Key idea
(2a−b)−(a−2b)=a+b, so the three squares form a Pythagorean triple; and a triple can have 3 dividing the difference of its legs’ squares only when 3 divides both legs.
Write 2a−b=p2, a−2b=q2 and a+b=r2. The first minus the second is the third: p2−q2=r2,that isq2+r2=p2, so (q,r,p) is a Pythagorean triple. Solving the last two equations for a and b, b=3r2−q2,a=32r2+q2, so we need r>q and 3∣r2−q2, and we are minimising b.
Now the arithmetic that decides everything. Squares are 0 or 1 modulo 3, so if neither leg of the triple were a multiple of 3 we would have q2+r2≡2(mod3), which is not a square. So at least one leg is divisible by 3. If exactly one is, then r2−q2≡±1(mod3) and b is not an integer. Hence 3∣qand3∣r.
Write q=3Q, r=3R; then p=3P and (Q,R,P) is itself a Pythagorean triple, and b=39R2−9Q2=3(R2−Q2)=3(R−Q)(R+Q). The smaller leg of a Pythagorean triple is at least 3: from Q2=P2−R2 with P≥R+1 we get Q2≥2R+1≥2Q+3, that is (Q−3)(Q+1)≥0. (It is not 0, since q=0 would make p=r and the squares would not be distinct.) So Q≥3, R≥Q+1≥4 and R+Q≥7, and R>Q gives R−Q≥1. Therefore b≥21, with equality only for (Q,R)=(3,4).
That case does occur: q=9, r=12, p=15 give b=21,a=32⋅144+81=123, and then 2a−b=225=152, a−2b=81=92, a+b=144=122, three distinct squares. So the smallest possible b is 21.
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=2 we get ∣4+25−65∣=36=62, and at n=4 we get ∣16+625−65∣=576=242. The real content of the problem is showing that the list stops there, so that the answer is 2+4=6. We rule out the odd exponents and the even ones by quite different arguments.
No odd exponent works
The case n=1 gives 58, which is not a square, so take n odd with n≥3, where the expression is comfortably positive. Working modulo 3, where both 2 and 5 are congruent to −1 and 65 is congruent to 2, 2n+5n−65≡(−1)n+(−1)n−2≡−1−1−2≡2(mod3) for odd n. Every perfect square is congruent to 0 or 1 modulo 3, never to 2, so no odd exponent can succeed.
No even exponent beyond four works
Let n be even with n≥8, so that 2n comfortably exceeds 65. The point is that 5n is itself a perfect square when n is even, namely (5n/2)2, and our expression sits just above it: 2n+5n−65=(5n/2)2+(2n−65). 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, and that would require 2n−65≥2⋅5n/2+1. This is hopeless, because 5n/2=(5)n and 5>2, so 5n/2 already exceeds 2n on its own. The gap between consecutive squares up there is wider than the amount 2n−65 we have to spend.
Only n=6 escapes both arguments, and it fails on inspection, since 64+15625−65=15624, one short of 1252. The solutions are n=2 and n=4, and their sum is 6.
Answer 6
Solution: IOQM 2020, Q29
Key idea
Strip out the common factor of a and b. The coprime part forces the difference p−q to divide the common factor, and the whole sum then collapses to t(p2+pq−q2), a product of two independent quantities that is easy to push against the ceiling.
Write g=gcd(a,b) and a=gp, b=gq with p>q≥1 and gcd(p,q)=1. Then c=a−bab=g(p−q)g2pq=p−qgpq. Because p and q are coprime, any common factor of p−q with p would also divide q, and similarly the other way round, so p−q is coprime to pq. For c to be a whole number, then, p−q must divide g outright. Write g=(p−q)t.
Everything is now expressed in three free parameters: a=(p−q)tp,b=(p−q)tq,c=tpq, and the quantity we care about factors pleasantly, a+b+c=t[(p−q)(p+q)+pq]=t(p2+pq−q2).
So we are choosing a coprime pair p>q, computing v=p2+pq−q2, and then taking t as large as the ceiling permits. No comparison of the possibilities is needed, because the question asks for the largest value of a+b+c not exceeding 99, and the ceiling itself is reached: the pair (p,q)=(3,1) gives v=11, and t=9 makes tv=99 exactly.
Taking p=3, q=1 and t=9 gives a=54, b=18 and c=27, and indeed 54−1854⋅18=36972=27,54+18+27=99.
Answer 99
Solution: IOQM 2023, Q11
Key idea
Multiplying by 16 completes the square on the right, turning the condition into (4m−8n+5)(4m+8n−5)=231, and 231 has only a handful of factorisations.
The right-hand side is a quadratic in n with an awkward middle term, so complete the square after clearing the fraction that would otherwise appear. Multiplying m2=4n2−5n+16 by 16, 16m2=64n2−80n+256=(8n−5)2+231. Hence 16m2−(8n−5)2=231, which factorises as (4m−(8n−5))(4m+(8n−5))=231=3⋅7⋅11.
Write u and v for the two factors, so uv=231, u+v=8m and v−u=2(8n−5). Since m is a positive integer, u+v>0, and as uv>0 both are positive. The condition that really cuts the list down is 8∣u+v; and once that holds, v−u must also be twice an odd number of the right shape for n to be an integer.
Running through the eight ordered factorisations: (u,v)(1,231)(3,77)(7,33)(11,21)(21,11)(33,7)(77,3)(231,1)u+v232804032324080232m2910544510298n−5=(v−u)/2115⇒n=1537(not ≡3mod8)13(no)5(no)−5⇒n=0−13⇒n=−1−37⇒n=−4−115(no) The surviving pairs (m,n) are (29,15), (4,0), (5,−1) and (10,−4), with ∣m−n∣ equal to 14, 4, 6 and 14. The maximum is ∣m−n∣=14.
The problem’s insistence that n may have any sign is doing real work: three of the four solutions have n≤0, and one of them attains the maximum.
Answer 14
Solution: IOQM 2024, Q25
Key idea
The two averages determine the size of M outright, so the squares are seven in number and sum to 588; then the largest is bounded by what the other six must leave behind.
Let M contain k squares along with 92. From the two averages, sum of M=85(k+1),sum of the squares=84k, and these differ by 92: 85(k+1)−84k=92⟹k+85=92⟹k=7. So there are seven distinct positive squares with total 84⋅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,36, totalling 91, so the largest square is at most 588−91=497, giving N≤22 since 222=484 and 232=529.
It remains to check that N=22 is attainable, that is, that six distinct squares different from 484 sum to 588−484=104. Starting from the minimum 91 we need 13 more, and replacing 36 by 49 does exactly that: 1+4+9+16+25+49=104. So M={1,4,9,16,25,49,484,92} works, and N=22.
Answer 22
Solution: IOQM 2024, Q26
Key idea
First show that n=⌊x⌋ is positive. On its window [n,n+1) the left side increases, so n3 must lie between the endpoint values. The left inequality factors, and successive differences settle the right.
Put n=⌊x⌋ and f(x)=15x2+15x+16, so the equation reads f(x)=n3 with x in the window [n,n+1). First, n is positive: f(x)=15(x+21)2+449>0, so n3>0. On non-negative arguments f is increasing, since for 0≤u<v, 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), and both halves can be settled exactly.
The left inequality
Here 15n2+15n+16≤n3, that is n3−15n2−15n−16≥0. This cubic factors: n3−15n2−15n−16=(n−16)(n2+n+1), and the quadratic factor is positive for every n, so the condition is exactly n≥16.
The right inequality
Here n3<15(n+1)2+15(n+1)+16=15n2+45n+46, that is g(n)<0 where g(n)=n3−15n2−45n−46. Now g(17)=−233 and g(18)=116, so 17 passes and 18 fails. And g increases from there on, since g(n+1)−g(n)=3n2−27n−59, which is positive at n=18, where it equals 427, and grows with n. So no n≥18 passes.
Putting the two together, n=16 and n=17 are the only values that work, and the required sum is 16+17=33. The case n=16 is worth seeing exactly: 60⋅4096−735=4952, so x=(495−15)/30=16 lands on the left end of its own window.
Answer 33
Solution: IOQM 2024, Q30
Key idea
With AC=b the two conditions become ac=12b and (a+c)2=b2+24b, so b2+24b must be a perfect square, which factorises as (b+12−k)(b+12+k)=144.
Let the legs be a=BC and c=AB and the hypotenuse b=AC. The altitude to the hypotenuse satisfies BD⋅AC=AB⋅BC, so 12b=ac. Also a2+c2=b2, and therefore (a+c)2=b2+2ac=b2+24b. The perimeter is a+c+b, and b is an integer, so the perimeter is an integer exactly when a+c is, that is, exactly when b2+24b is a perfect square, say k2.
Complete the square: (b+12)2−k2=144, so (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 2s and 2t gives st=36 and b+12=s+t, that is b=s+t−12,st=36.
One more constraint decides the matter. Since (a−c)2≥0, we have 2ac≤a2+c2=b2. Together with ac=12b, this gives 24b≤b2,b≥24, as b>0. Running through the factorisations of 36: (s,t)(1,36)(2,18)(3,12)(4,9)(6,6)s+t3720151312b258310 Only b=25 clears the bound. A check confirms that it is genuine: a+c=625+600=35 and ac=300, so a and c are the roots of t2−35t+300, namely 15 and 20. The familiar 15-20-25 triangle has altitude 15⋅20/25=12 and perimeter 60.
So the minimum possible length of AC is 25.
Answer 25
Solution: IOQM 2025 Part SEP, Q28
Key idea
For a≥7 the number 4a+4a2+4 is squeezed strictly between the consecutive squares (2a)2 and (2a+1)2, so only small a need testing.
Since b2=4a+4a2+4>(2a)2, we have b>2a. On the other side, (2a+1)2=4a+2a+1+1, so b<2a+1 as soon as 4a2+4<2a+1+1, that is 4a2+3<2a+1. This holds for every a≥7, by induction. At a=7 it reads 199<256. And if it holds at some a≥7, then 4(a+1)2+3<2(4a2+3)<2⋅2a+1=2a+2, where the first step is the inequality 4a2+8a+7<8a2+6, which rearranges to 4a2−8a−1>0 and is true for every a≥3.
So for a≥7 there is no integer strictly between 2a and 2a+1, and no solution exists.
That leaves a≤6, which is a short check: a1234564a+4a2+4123610432411284244square?no62no182nono The solutions are (a,b)=(2,6) and (4,18), and the larger value of a+b is 4+18=22.
Answer 22
Solution: IOQM 2026, Q15
Key idea
Since a2+b2 is more than 2026, a+b is at least 47. And a2+b2 has the same parity as a+b, which rules out every total below 51.
Write s=a+b and t=c+d, so t≥2 and the total is s+t.
First, s≥47. Since (a−1)(b−1)≥0, we have ab≥s−1, and so a2+b2=s2−2ab≤s2−2s+2=(s−1)2+1. If s≤46 this is at most 452+1=2026, but a2+b2=2026+cd2 is at least 2027.
Then parity. A square has the same parity as the number squared, so a2+b2 has the parity of s, while 2026+cd2 has the parity of cd. A total of at most 50 with s≥47 and t≥2 leaves two cases.
s=47 and t≤3. Here s is odd, so cd is odd, so c and d are both odd and t=2, with c=d=1. Then a2+(47−a)2=2027, which simplifies to a2−47a+91=0. Its discriminant is 472−364=1845, which lies strictly between 422=1764 and 432=1849, so there is no integer a.
s=48 and t=2. Then c=d=1 and cd is odd while s is even, which parity forbids.
So the total is at least 51, and it is reached: a=45, b=2, c=3, d=1 gives 2025+4−3=2026 and a+b+c+d=51.
Answer 51
Solution: IOQM 2026, Q28
Key idea
Both tenth terms are fixed multiples of the starting values, b10=512b1 and a10=21a1+34a2. The bound leaves b1=1,2,3, and in each case a2+b1 has to be a multiple of 21.
Doubling nine times, b10=512b1, and 512b1<2026 leaves b1=1,2,3.
Running the rule for a forward from a1 and a2, n345678910ana1+a2a1+2a22a1+3a23a1+5a25a1+8a28a1+13a213a1+21a221a1+34a2 the coefficients being consecutive Fibonacci numbers. The sequence increases exactly when a1<a2, since every later term is a sum of two earlier positive ones.
Write k=b1, so the equation is 21a1+34a2=512k. Since 546=26×21, 34a2−512k=34(a2+k)−546k is a multiple of 21 exactly when 34(a2+k) is, and as 34 and 21 share no factor, a2+k must be a multiple of 21. Also 34a2<512k.
k=1: a2≤15, and a2+1 is never a multiple of 21. No solution.
k=2: a2≤30 and a2+2 a multiple of 21 give a2=19, then a1=18. Since 18<19 this works, and a1+b1=20.
k=3: a2≤45 gives a2=18 or 39. The first needs a1=44, which is not less than 18; the second gives a1=10, which works, and a1+b1=13.
The possible values are 20 and 13, and their sum is 33.
Answer 33
Solution: IOQM 2025 Part SEP, Q7
Key idea
Since a is irrational, matching the irrational parts forces y=0, and then the equation says a is a triangular number.
Squaring the given equation, x−x+a=a−2ya+y2, that is, x−a−y2=x+a−2ya. The left-hand side is an integer, so x+a=m+2ya for the integer m=x−a−y2. Squaring again, x+a=m2+4y2a+4mya, and since a is not a perfect square, a is irrational, so 4my=0.
If m=0 then x+a=2ya, hence x=(4y2−1)a and m=x−a−y2=(4y2−2)a−y2=0, giving a=4y2−2y2<1, which no positive integer a satisfies. So y=0.
With y=0 the original equation reads x−x+a=a, so x+a=x−a. Setting t=x−a≥0 and squaring, x+a=t2, and subtracting the two expressions for x, t2−2a=t,a=2t(t−1). So a is a triangular number. Conversely, every triangular number a=21t(t−1) gives a solution, taking y=0 and x=t2−a; the hypothesis that a is not a perfect square then keeps only those triangular numbers that are not squares, which rules out 1 and 36 among the small ones.
The largest triangular number below 100 is 214⋅13=91, and 91 is not a perfect square, as required. (Here t=14 and x=196−91=105.)