A calculator puzzle
“Your calculator has broken, leaving you with only the buttons for
When this showed up on Reddit, I knew I was in for a) a rough ride and b) a bit of a treat. (The poster mentioned that it was an International Mathematical Olympiad problem, and those are often the worst kind of fun.)
In this post, I want to talk not just about the solution, but the nebulous process that took me there.
Below the line be spoilers.
My eventual solution
I’ll start by presenting my solution, pared down and simplified, stripped away of all of the scaffolding that was used in its construction.
Proposition: all numbers of the form
Observation:
Observation: 1 can be produced (from, e.g.,
Lemma: if
Proof: If
If
Proof of proposition: Our target number,
Since the maximum component is, in each case, a smaller integer than the one before, while bounded from below by 1, repeatedly applying the process shows that all numbers of the form
Other paths
This was not, of course, how I originally approached it. I started by playing. What numbers could I generate? I quickly stumbled on applying
I couldn’t see how to get from there to any rational number, though. I applied the same functional combination to
(Eventually, after finding the solution above, I realised that applying the function to
Thinking in triangles
This is a situation where having a geometric understanding of what’s going on really helps.
If you know the fraction
- one with legs of
and (and a hypotenuse of ); - one with a hypotenuse of
and legs of and .
The insight this gave me was that the process was invertible: if a number can be produced from another number, the other number can be produced from the first.
I could then consider a fraction like
The Holy Cow moment
While I was trying to straighten out the proof of my solution, I almost jumped out of the bath 2.
The step outlined in the lemma is exactly analogous to a step in the Euclidean algorithm for finding the highest common factor of two numbers.
And since
This was a belter of a puzzle. I hope you enjoyed it as much as I did.
Footnotes:
1.
2. luckily, it was during the cold snap in February and Weymouth was spared the ordeal of me running naked down Abbotsbury Road shouting ‘eureka!’