In the past few months, LLM coding agents have gotten good enough that I pretty much never hand-write any code myself. This has increased my productivity, but has made my day job feel far less technically demanding and flow-y.
Some random twitter discourse reminded me the 2026 IMO just finished up in Shanghai, and I thought it would be fun to try a problem or two to scratch that itch before returning to my regularly scheduled AI slop generation.
As an added twist, I intentionally tried to reason and write this in my best approximation of CoT (i.e., directly writing my thoughts and trying to solve the problem inside my text editor), with the whimsy of trying to “experience” math the way an LLM does.
Of course, I didn’t list out literally every thought I had, but I figure the internal ones are more like activations anyways… The only corrections I made were typos and a few grammatical mistakes.
IMO 2026, Problem 1
There are integers greater than written on a blackboard, not necessarily different. In a move, Confucius chooses two integers and from different places on the blackboard and replaces these two integers with
He continues to make moves while it is possible to do so.
(a) Prove that, regardless of the choices of Confucius, after finitely many moves, exactly one integer on the blackboard is greater than .
(b) Prove that the value of does not depend on the choices of Confucius.
I’ve always liked these number theory/invariant type problems, and given this was a non-geometry P1, I started here. I’d probably have a lot of trouble doing this for more difficult problems, but I’m also not nearly as good at contest math as the LLMs these days…
For part (a), it’s very natural to look for some positive state value that Confucius must decrease with every move, and just glancing at the operation makes the product of all the numbers a natural candidate, as the two new numbers always have product , which is less than or equal to the original .
The only “failure” case is when and are coprime, in which case they get remapped to (recall that neither nor can itself be ). This gets us an extra , which is what we wanted to show anyways, so we can monkey-patch our state value as “product of all numbers, plus the number of non-1 numbers”.
And we’re pretty much done with the first part, as we always have a move as long as at least 2 numbers are not 1. We can only make finitely many moves since we have our positive decreasing thingy associated with each move, and the only way we run out of moves is if everything except one thing is 1, QED.
Part (a) had a pretty obvious first thing to try which happened to work out pretty smoothly. For part (b), it seems a bit less obvious what we should look at, but hopefully we can find some invariant (maybe related to the product?) that uniquely determines the final state.
Since the product itself tends to decrease based on our solution to part (a), the next thing to look at is probably the lcm, since gcd and lcm are already in the problem. Let’s try and as an example, this goes to and , so lcm doesn’t really seem to work.
Let’s consider a particular prime, say . This is a common way to “coordinate bash” number theory problems involving gcd and lcm, since they simply act as min and max on the prime power exponents.
Let’s say divides exactly times and , times. Then, divides the gcd times and the lcm/gcd thing times, so the power in the total product changes from to .
So basically, we lose the smaller one. This doesn’t solve the issue, since the max is composed of the min and the max-min, so there’s not some obvious invariant to track.
To make it simpler to reason about, let’s say WLOG that , so we go from to . This seems a lot like the Euclidean algorithm, so my next hypothesis is to consider the gcd of all the exponents.
Based on the above, we can run our “Euclidean algorithm” on the , where are our whiteboard numbers. If is the gcd of the , then it remains unchanged by any move ( here). Since the final state is all 1s except for one number, the power of in that number’s prime decomposition must be , so we know the number’s prime decomposition and thus the number itself from the original numbers, QED.
I had an LLM check this solution afterwards, and it found a minor oversight: in part (a), I should have explicitly stated the two output numbers can’t both be 1, so the final state can’t be all 1s.