# What is the density of solutions for Pythagoras' and Fermat's equation $x^2+y^2=z^2$

It is now proved that, for integer $n\geq 2$, the equation $x^n+y^n=z^n$ has integer solution only when $n=2$.

When $n=2$, this equation has an infinity of solutions.

My question is whether there is some established knowledge on the density of solutions and its variation in the space of integer pairs $(x,y)$ or $(x,z)$.

The Lehmer asymptotic evaluation does give some indication of what I am after. But it is limited. If, in the $(x,y)$ plane, all pythagorean triples were concentrated around the $x=y$ line (the first diagonal), none being near the horizontal and vertical axes, it could follow the Lehmer density result, though be far from asymptotically uniform in relative density.

So I would rather consider something more or less like the following (which may not be quite correct a way to express what I have in mind):

Let $P(m,n)$ be the number of primitive Pythagorean triples $(x,y,z)$ with $m/2\leq x\leq m$ and $n/2\leq y\leq n$, with $gcd(x,y,z)=1$. What is the limit $$\lim_{p \rightarrow \infty} \frac{P(ap,bp)}{abp^2/4}$$ where $a,b,p\in \mathbb N$? Note that $abp^2/4$ is simply the surface of the rectangle where primitive Pythagorean triples are considered for $P(ap,bp)$.

This is intended just to control the plane direction in which the density is measured. But one could consider more complex relations between the two parameters of $P$.

Or another question (which I think is not equivalent, but I am not sure):

Is the set $\{x/y\mid x^2+y^2=z^2 \wedge (x,y,z)\in \mathbb N^3\}$ dense in the reals?

And I have similar questions regarding $(x,z)$ rather than $(x,y)$.

• I will forever wonder what in my original question motivated downvoting. I am not a mathematician, I know too little of the topic for effective search on my own, and my own motivations for the question are not mathematical. – babou Sep 27 '14 at 22:02

First, it's a little silly to call this "Fermat's equation".

Now, points with both coordinates rational are dense on the unit circle; any line through $(1,0)$ with rational slope hits the circle in such a point. This should enable you to answer your questions about density.

• Thanks. Sorry for the name used. My interest came from an actual equation that happens to have the same form. I was so convinced that I know noting of the topic that it blocks reasonning. And I even misread your answer. OK now, so simple. – babou Oct 12 '14 at 15:10

Let $P(n)$ be the number of primitive Pythagorean triples, that is $\gcd(x,y,z)=1$, with $z \leq n$.

Lehmer showed that

$$\lim_{n \rightarrow \infty} \frac{P(n)}{n} = \frac{1}{2\pi}$$

The reference is Lehmer, D.N. (1900). Asymptotic evaluation of certain totient sums. American Journal of Mathematics, 22(4), 293-335.

• A heuristic derivation of this result is given by Fred Helenius here. mathforum.org/kb/message.jspa?messageID=1673162 – Daniel Pietrobon Sep 27 '14 at 10:21
• Thanks. I used your answer to mak my question more precise, though I already mentioned that I was more interested in pairs of arguments. Or can it be deduced simply from Lehmer's result? – babou Sep 27 '14 at 22:06
• This is beautiful... – recursive recursion Sep 27 '14 at 23:18