The Emoji Problem: Part I
by greenturtle3141, Jan 19, 2022, 1:40 AM
Reading Difficulty: 2-3/5
Prerequisites: Basic polynomial theory, e.g. Vieta's Formulas, should be enough
In the event that the culture of today is lost to time, I will give some context surrounding why this problem is worth looking at.
The internet has been plagued with "emoji math problems" that look something like this:

They're more or less constructed so that it's easy to mess up (look carefully at the bananas), so that people get different answers sparking arguments and discussion and viralness etc. etc...
Naturally, actual math people are sick of this. In early 2017, a reddit thread titled "I'm really sick of all the facebook fruit math bull that's going on lately. Does anyone want to create a truly difficult math problem with pictures of fruit to counter this?" appeared on r/math. One user there created this:

This isn't too hard. Some patience or a brute force search can easily solve this in integers. But here's where the fun begins.
A guy by the name of Sridhar Ramesh saw the above image, and decided to make a small tweak before popularizing it.

And just like that, the problem became notoriously difficult. The smallest solution is more than
digits long. This meme is described as a " clever... wicked, joke" by Dr. Alon Amit, and is widely believed to require a "massive level of knowledge about elliptic curves".
But since when did that stop us? In this post, we will solve this problem. Or rather, I'll described how I finally solved it. Buckle your seatbelts.
A Warmup
Let's first tackle an easier problem.
Problem: Find all Pythagorean triples.
Solution. We are trying to solve the Diophantine equation
in non-negative integers. Except this kinda sucks. We're going to be much happier trying to instead solve
where
and
are non-negative rationals. This is basically the same problem because solving
is the same as solving
, so we're essentially letting
and
. Caveats
The reason why we're much happier about this is because the problem is now "find all rational points on the unit circle", where a rational point is just a point with rational coordinates. Is this really any easier?
Here's the trick that blows up this problem.
Why is this true? To find the coordinates of this second point, we are solving the system of equations
and
. We already know one solution though:
. So when we eliminate
to get the quadratic
we may reason as follows:
We conclude that drawing any line of rational slope through
will give us another rational point on the circle. But it's even better than that. Note that if
is another rational point, then the line connecting
and
must have rational slope. So, if we draw every line of rational point through
, we hit EVERY possible rational point on the circle.
Let's find that second point for all possible slopes
! Expanding out equation
, we get:
We already know
was a root, so the
-coordinate we're looking for is the other root, given by
. The corresponding value for
is
. Clearing denominators and cleaning up signs, we see that ALL Pythagorean triples may be characterized as
for positive integers
, up to some integer multiple. This is a very nice fact in Olympiad number theory that you may have heard before.
The important takeaway is that "drawing lines can get you more points". Here, we just drew one line through a point to get another point. Although this won't quite work for the original problem, the idea is very similar. Let's do it!
Getting Started
So we're starting with the following equation:
Clearing denominators, this eventually becomes this:
Instead of trying to solve this in positive integers, we're going to write this in terms of
and
and try and find rational points, positive or negative. Hopefully, this will make things easier.
Dividing the equation by
, this becomes:

If we graph this equation, it looks like this:

You might notice that this is "tilted
". This makes sense because switching
and
should not change anything in the above equation.
For my own convenience (this step isn't strictly necessary, but it's what I did), I decided to rotate this graph so that it was symmetrical across the
axis. I did this by substituting
and
. Now it's an equation involving new rational variables
and
, and the equation became:
This is a lot nicer. The graph looks like this now:

Nice and symmetrical! We call this curve an elliptic curve.
Just by looking at the graph, there are some pretty easy rational points that we can spot:
,
, and
, which I will call
,
, and
. (There is a reason for the weird labels, I'll talk about it in Part 2.)

Unfortunately, finding these points does not at all mean we are done. These points correspond to invalid solutions to the original problem. However, can we use these "easy points" to find even more points?
The Return of the Line Trick
This process will let us obtain more points.
There are some things to explain here: Why must the line intersect a third time, and why must the third intersection be a rational point? We reason as follows, analogously to the warm-up:
Cool! An important remark: Intersections are counted including multiplicity. It's possible, for example, to take
and
to be the same point. Then the "line" is actually the tangent to the curve at
, and this still works. Be sure to understand why!
Anyways, we now know that if we connect two rational points on the elliptic curve, then we can get another rational point on the curve. Let's try it out.
By connecting
and
, with a line, we find that there is a third intersection at
.

And indeed, if we plug it in, it works! What else can we get?
By "connecting
and
with a line", or taking the tangent line to
, we can find yet another third intersection with the curve.

This time it's at
. That's pretty lame: We could've figured that out by taking the previous point we got and flipping it over the
-axis. Is there anything else we can get easily?
The answer is no. This is because these
points (and another hidden "point" that I won't describe) are points of torsion. No matter how many more times we use the line trick, we won't get any more new points.
That sucks. How can we get points that can "escape" these
points?
Finding More Points (of infinite order)
Since I am a dumb person, I wrote some Mathematica code to try and find some less trivial points on the curve.

This found some nice points! I experimented a lot with all the points, but the one that ended up doing the job was this first point,
. I'll call this point
.

Before I go on and find more points, I need to address two things.
First, what rational point am I even trying to find? If we test
out, we find that it doesn't work because some of the resulting variables
may end up being negative. So, we're trying to find rational points
such that they correspond to a completely-positive triple
.
When does that happen? Let's reason it out by backtracking a bit.
This is captured by the following green region:

To reiterate, our goal is to find a rational point on the curve that lies in this region. Hence, this turns into a little fun game of "math football": We need to use the line trick to generate more and more points until we reach the "goal" that is the green region.
This is an absolute pain to do by hand. Fortunately, I have something called Mathematica! This brings me to the second thing I want to address: How can we streamline the line trick?
Using Mathematica to do expansions for me, I found that the cubic equation resulting from finding the third intersection of the line passing through points
and
has sum of roots given by:
So, by Vieta, we can write a formula for the third intersection's
-coordinate:
Similarly, I managed to write a formula for the third intersection, given a tangent line at a point
:
What a mess! This is precisely why our numbers are going to get huge.
Lastly, these formulas only give the
-coordinates. Finding the (positive)
-coordinate is easy via one last formula, that's pretty easy to derive (literally just solve for
):

Now let's finish the fight.
Finale
From
, I will draw a tangent line and find a third intersection at a new point
. (Again, worry not about the labels!)

Our formulas give the coordinates for
:

From
, I will draw yet another tangent line and find a third intersection at a new point
.


Again, Mathematica will tell us the coordinates of
via the formulas.

We're not able to get into the green region yet, so we need to keep going. Hideously, I will draw yet another tangent line at
to obtain the point
:

Coordinates are:

We're done with tangents now! For convenience's sake, I also plotted down the point
, which is just
with negated
-coordinate, and I connected
and
with a line to get the point
:

Coordinates:

This was my grand plan! I needed a point way up there somehow in order to finally get into the green region with one more line. What is that line you ask? I'm glad you asked! All this time, I was hiding this one last "nice" rational point I was saving until the very end:
! By drawing the line between
and
, we finally end up with a point in the green region:

Coordinates:

The light at the end of the tunnel is near! Letting this final point be
, we compute
and
to get
and
:

Recalling that these are equal to
and
respectively, we let
be the LCM of the denominators and
be the resulting numerators when we find a common denominator. This gives us the following humungous solution... in positive integers!



And finally, to truly admire our work, we can confirm that, indeed, this works.

Prerequisites: Basic polynomial theory, e.g. Vieta's Formulas, should be enough
In the event that the culture of today is lost to time, I will give some context surrounding why this problem is worth looking at.
The internet has been plagued with "emoji math problems" that look something like this:

They're more or less constructed so that it's easy to mess up (look carefully at the bananas), so that people get different answers sparking arguments and discussion and viralness etc. etc...
Naturally, actual math people are sick of this. In early 2017, a reddit thread titled "I'm really sick of all the facebook fruit math bull that's going on lately. Does anyone want to create a truly difficult math problem with pictures of fruit to counter this?" appeared on r/math. One user there created this:

This isn't too hard. Some patience or a brute force search can easily solve this in integers. But here's where the fun begins.
A guy by the name of Sridhar Ramesh saw the above image, and decided to make a small tweak before popularizing it.

And just like that, the problem became notoriously difficult. The smallest solution is more than

But since when did that stop us? In this post, we will solve this problem. Or rather, I'll described how I finally solved it. Buckle your seatbelts.
A Warmup
Let's first tackle an easier problem.
Problem: Find all Pythagorean triples.
Solution. We are trying to solve the Diophantine equation








It's not exactly the same because although every
will correspond to a
in this way, we can't go the opposite direction. For instance,
and
both correspond to
. The fix is easy: Whatever solutions we get for the
from the
we just remember that we can get any multiples as well. This issue will more or less fix itself, see if you can spot why.







The reason why we're much happier about this is because the problem is now "find all rational points on the unit circle", where a rational point is just a point with rational coordinates. Is this really any easier?
Here's the trick that blows up this problem.
- Start by finding some point
that works. I'll take
.
- Draw any line with rational slope going through
. Something like,
, where
is rational.
- This will (pretty much) always intersect the circle at a second point,
.
- Then
will always be another rational point!
Why is this true? To find the coordinates of this second point, we are solving the system of equations





- The coefficients of the quadratic are rational.
- Therefore, by Vieta, the sum of the roots are rational.
- We know that one root is rational, since we drew the line through a rational point. Therefore, the other root must be rational.
- If
is rational, then
is rational, hence
is rational.
- Therefore, the second point of intersection of this line with the circle is a rational point.
We conclude that drawing any line of rational slope through





Let's find that second point for all possible slopes










The important takeaway is that "drawing lines can get you more points". Here, we just drew one line through a point to get another point. Although this won't quite work for the original problem, the idea is very similar. Let's do it!
Getting Started
So we're starting with the following equation:




Dividing the equation by




You might notice that this is "tilted



For my own convenience (this step isn't strictly necessary, but it's what I did), I decided to rotate this graph so that it was symmetrical across the







Nice and symmetrical! We call this curve an elliptic curve.
Just by looking at the graph, there are some pretty easy rational points that we can spot:







Unfortunately, finding these points does not at all mean we are done. These points correspond to invalid solutions to the original problem. However, can we use these "easy points" to find even more points?
The Return of the Line Trick
This process will let us obtain more points.
- Start with two rational points
and
that lie on the elliptic curve.
- Draw the line
. Note that this has rational slope because
and
are rational points.
will always intersect the elliptic curve a third time (including multiplicity), at a point
.
- Moreover,
will always be another rational point!
There are some things to explain here: Why must the line intersect a third time, and why must the third intersection be a rational point? We reason as follows, analogously to the warm-up:
- The third point
satisfies the system of equations
where
is the equation of the line passing through the points
and
.
- If we solve for
in the second equation, and substitute it into the first equation to eliminate the variable, then we are left with a cubic equation in
.
- This cubic has rational coefficients. This is because the coefficients
and
have to be rational, since the line has rational slope and passes through rational points.
- Therefore, by Vieta, the sum of the roots of the cubic is a rational number.
- But two of the roots are given by the
-coordinates of
and
, both of which are rational.
- Therefore, the third root is rational. This means that the
coordinate of
is rational.
- Using
, we conclude that the
coordinate is rational as well. Thus
is a rational point.
Cool! An important remark: Intersections are counted including multiplicity. It's possible, for example, to take



Anyways, we now know that if we connect two rational points on the elliptic curve, then we can get another rational point on the curve. Let's try it out.
By connecting




And indeed, if we plug it in, it works! What else can we get?
By "connecting




This time it's at


The answer is no. This is because these

That sucks. How can we get points that can "escape" these

Finding More Points (of infinite order)
Since I am a dumb person, I wrote some Mathematica code to try and find some less trivial points on the curve.

This found some nice points! I experimented a lot with all the points, but the one that ended up doing the job was this first point,



Before I go on and find more points, I need to address two things.
First, what rational point am I even trying to find? If we test




When does that happen? Let's reason it out by backtracking a bit.
- We can assume that some variable (WLOG
) is positive, because if all variables
are negative then we get an all-positive solution by flipping all the signs.
- Now,
exactly when
. That is,
.
- This means we want
and
. In other words,
.
This is captured by the following green region:

To reiterate, our goal is to find a rational point on the curve that lies in this region. Hence, this turns into a little fun game of "math football": We need to use the line trick to generate more and more points until we reach the "goal" that is the green region.
This is an absolute pain to do by hand. Fortunately, I have something called Mathematica! This brings me to the second thing I want to address: How can we streamline the line trick?
Using Mathematica to do expansions for me, I found that the cubic equation resulting from finding the third intersection of the line passing through points







Lastly, these formulas only give the




Now let's finish the fight.
Finale
From



Our formulas give the coordinates for


From




Again, Mathematica will tell us the coordinates of


We're not able to get into the green region yet, so we need to keep going. Hideously, I will draw yet another tangent line at



Coordinates are:

We're done with tangents now! For convenience's sake, I also plotted down the point







Coordinates:

This was my grand plan! I needed a point way up there somehow in order to finally get into the green region with one more line. What is that line you ask? I'm glad you asked! All this time, I was hiding this one last "nice" rational point I was saving until the very end:




Coordinates:

The light at the end of the tunnel is near! Letting this final point be














And finally, to truly admire our work, we can confirm that, indeed, this works.

This post has been edited 9 times. Last edited by greenturtle3141, Dec 18, 2024, 7:09 PM