Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for interesting problems (in number theory, or otherwise) that lead to interesting diophantine equations. The solution to the problem may be known, or it may be open... I just care for connections between problems and equations that one can use to motivate the study of diophantine equations, arithmetic geometry, and so on. I am more interested in problems that can be stated in elementary terms (that an undergraduate can understand), but I'll be happy to see any problems that you think fit the bill.

I'll start with one of my favorites: the congruent number problem leads to the study of elliptic curves of the form $y^2=x^3-n^2x$.

PS: the problem does not need to be a famous problem, any problem that is interesting, cute, entertaining, and leads to a diophantine equation also works!

share|cite|improve this question
@JyrkiLahtonen I like it! Can you add it as an answer below? – Álvaro Lozano-Robledo Aug 27 '12 at 15:38
There is always the very old Pythagorean triples family of problems. For applications, electron orbits. – André Nicolas Aug 27 '12 at 19:47
Dear @AndréNicolas, do you have a Pythagorean triples favorite problem in mind? I am not sure what you refer to as electron orbits as an application of triples... A link perhaps? – Álvaro Lozano-Robledo Aug 28 '12 at 4:07
up vote 8 down vote accepted

How about the Perfect Cuboid, which is still an open problem, to the best of my knowledge.

This problem leads to a system of Diophantine equations:

$$a^2 + b^2 = d^2$$ $$a^2 + c^2 = e^2$$ $$b^2 + c^2 = f^2$$ (i.e. the face diagonals of the cuboid must be integers) and

$$a^2 + b^2 +c^2 = g^2$$ (i.e. the space diagonal must also be an integer.)

It is easily understandable, and at first glance, looks as if it ought to be solvable with a bit of computer searching, but turns out to be a rather harder than it might seem. The interesting (or frustrating) thing here is that it is possible to find solutions for three of the four equations, but no solution is known that satisfies all four.

share|cite|improve this answer
What is the diophantine equation that needs to be solved here? – Álvaro Lozano-Robledo Aug 27 '12 at 15:34
I will edit to explain ... – Old John Aug 27 '12 at 15:35
Great, thanks! It is a nice problem. – Álvaro Lozano-Robledo Aug 27 '12 at 15:39

The triangular-square problem, which marlu posted, leads to a concrete instance of Pell's equation. There are quite a few elementary problems leading to Pell's equation for small values of $d$: see Barbeau's book "Pell's Equation". These are nice problems, but because $d$ turns out to be a small explicit number the fact that a general $x^2 - dy^2 = 1$ with nonsquare $d > 1$ is nontrivially solvable is not directly relevant. Here is an example of a problem that involves infinitely many instances of Pell's equation, due to H. Alder and W. Simons ($n$ and $n+1$ Consecutive Integers with Equal Sums of Squares, Amer. Math. Monthly 74 (1967), 28--30.)

For a positive integer $n$ we would like to find a set of $n$ consecutive squares and $n+1$ consecutive squares whose sums are equal: $$ x^2 + (x+1)^2 + \cdots + (x+n-1)^2 = y^2 + (y+1)^2 + \cdots + (y+n)^2 $$ for some integers $x$ and $y$. (When $n = 1$ this is the problem of finding a Pythagorean triple with consecutive legs: 3,4,5; 20,21,29; 119,120,169;....)

Writing $z=x-y$, after some tedious algebra the above equation is the same as $$ (y+n(1-z))^2 = n(n+1)z(z-1). $$ Let $a^2$ be the largest square factor of $n(n+1)$: $n(n+1) = a^2b$, where $b$ is squarefree. Then $a^2b$ is a factor of $(y+n(1-z))^2$, so (!) $ab$ is a factor of $y+n(1-z)$. Set $y+n(1-z) = abv$, with $v$ an integer. Then the above equation is the same as $$ a^2b^2v^2 = a^2bz(z-1) \Longleftrightarrow (2z-1)^2 - 4bv^2 = 1. $$

We are thus reduced to solving $u^2 - 4bv^2 = 1$ for integers $u$ and $v$ (necessarily $u$ is odd), and $4b$ is not a square. Aside from the factor of 4, which could be absorbed into $v$ by insisting $v$ be even, this is a fairly general Pell equation with squarefree $b$. (One solution is $u=2n+1$ and $v = a$, leading to $x = 2n^2 + 2n+1$ and $y = 2n^2 + n$, but that is not always the first solution: try $n=8$.)

Moreover, every squarefree $b > 1$ does arise in such a problem, because there is always an integer $n$ such that $n(n+1) = a^2b$ for some integer $a$: finding $n$ and $a$ such that $n(n+1) = a^2b$ is equivalent to $(2n+1)^2 - 4ba^2 = 1$, and the equation $X^2 - 4bY^2 = 1$ does have some integral solution $(X,Y)$ by the general theory of Pell's equation, with $X$ necessarily odd.

share|cite|improve this answer
Very nice problem. – Álvaro Lozano-Robledo Aug 29 '12 at 1:46

Given $n$ items, can you arrange them to form a triangle as well as a square? I.e. for which $n$ are there natural numbers $x$ and $y$ s.t. $$n = \frac{x(x+1)}{2} = y^2?$$ (This may be stated in a more entertaining way involving soldiers marching into battle in a square/triangle formation.)

The equation is equivalent to $$(2x+1)^2 - 2(2y)^2 = 1,$$ Pell's equation for $d= 2$. Its solution is related to the group of units of the ring of integers of $\mathbb Q(\sqrt{2})$, see square triangular number.

share|cite|improve this answer
Thanks! I like this type of problem too. – Álvaro Lozano-Robledo Aug 27 '12 at 19:03

For those with a classical taste there is always Problema Bovinum aka Archimedes' cattle problem.

share|cite|improve this answer

Have you looked at this paper?

You might enjoy reading this thread:

You might also find something helpful here:


share|cite|improve this answer
Nice paper! The Mathematical Atlas has a wealth of info, too! – amWhy May 20 '13 at 0:45
The Mathematical Atlas (and links to anything on Dave Rusin's webpages) now seems to be dead. – KCd Jun 19 '15 at 4:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.