# Generalizing Fermat's challenge to Frenicle

In 1643, Fermat asked Frenicle et al to find a special Pythagorean triple $a,b,c$ such that for $n=1$,

$$a+nb = r_1^2\\ a^2+b^2 = r_2^4\tag1$$

Equivalently,

$$\color{blue}{\big((p^2-q^2)^2-(2pq)^2\big)}+n\color{brown}{\big(2(p^2-q^2)(2pq)\big)} = r_1^2\tag2$$

This has polynomial solution $p,q = n^2+2, 2n.$ (And an infinite more, since it can be birationally transformed to an elliptic curve.) But this simple solution yields negative $a$ for $n=1,2,3,4$.

Fermat stated that the smallest positive answer for $n=1$ was,

$$n,a,b = 1,\;4565486027761,\; 1061652293520$$

Q: What is the smallest positive solution for $n=2,3,4$?

For $n=2$, I think it is,

$$n,a,b = 2,\;10386304269597791463121,\; 3672193546323671330640$$

though I am not sure.

This is a really nice question! I think your answer for $n=2$ is correct.

Equation $(2)$ can be shown to be equivalent to the elliptic curve \begin{equation*} v^2=u^3-(n^2+1)u \end{equation*} with \begin{equation*} \frac{p}{q}=\frac{nu-v}{n^2+1-u} \end{equation*}

The elliptic curve has one finite torsion point at $(0,0)$, though I have not attempted to prove this. There is, also, a point when $u=-1$ and $v=n$, so that the curve always has rank greater than zero.

I wrote a Pari-gp program which uses Denis Simon's ellrank code to determine the rank and generators of the curve. It then searched through rational points to find a minimum positive solution. The results are

n = 1

Rank of curve = 1

Minimum = [4565486027761, 1061652293520]

n = 2

Rank of curve = 1

Minimum = [10386304269597791463121, 3672193546323671330640]

n = 3

Rank of curve = 1

Minimum = [166911677107794033180761521, 383496393351054937416817200]

n = 4

Rank of curve = 2

Minimum = [230903401, 2224677000]

n = 5

Rank of curve = 1

Minimum = [104041, 679320]

n = 6

Rank of curve = 1

Minimum = [53641, 148200]

n = 7

Rank of curve = 1

Minimum = [3744841, 6868680]

n = 8

Rank of curve = 2

Minimum = [876353497971071281, 193103317517647440]

n = 9

Rank of curve = 3

Minimum = [152401, 142800]

• Thanks! Good to know I got $n=2$ right, and I'm glad you extended it to $n>4$. I checked with my parameterization of $(2)$ above and, after removing common factors, our solutions for $n=5,6,7$ are the same. However, for $n=8$, the parametrization yields the smaller, $$a,b = 771841,\,1082400$$ while yours is, $$a,b = 876353497971071281,\, 193103317517647440$$ What could be the reason? – Tito Piezas III Mar 1 '16 at 15:48
• I did a small Sage script following Allan's method and was able to find $a, b = 771841, 1082400$ by the same method. It correspond to the point $(-1,8)$ on the elliptic curve which is among the generators returned by Sage. It could be that Pari and Sage gives different sets of generators? – Jesper Petersen Mar 1 '16 at 18:50
• The problem was that I used the wrong variable name in one line of code, but this code gave your solutions for $n=1$ and $n=2$ so I assumed it was correct. Above solutions are unchanged apart from $n=4$ gives $45241, 26520$, and $n=8$ actually gives $166873, 272136$ as smallest solution. – Allan MacLeod Mar 2 '16 at 7:28
• I curious as to what points on the elliptic curves correspond to the solutions for $n = 2,3$. I am able to reproduce the solutions except for these two cases. – Jesper Petersen Mar 2 '16 at 17:51