SOLVING DIOPHANTINE EQUATIONS
Equations of the form-
af ( x) + bg ( y ) = c
where a,b, and c are integers are known as Diophante equations. The special case of
f(x)=x and y(x)=y leads to the linear Diophantine equation-
ax + by = c
and when f(x)=xn and g(y)=yn , with n an integer, it yields the non-linear
Diophantine equation-
ax n + by n = c
associated with Fermat’s last theorem. In all cases one seeks only those solutions for
which x and y are integers. Other Diophantine equations which have been studied
historically include-
x n − ny 2 = 1 and
61x 2 + 1 = y 2
We will find that some of these equations have multiple solutions while some have
none. Lets begin with the linear Diophantine equation ax+by=c. First define α=x/c
and β=y/c. We then have –
αa + β b = 1
which is essentially equivalent to the definition of the greatest common divisor
gcd(a,b). Take the special case of a=4 , b=-3 , and c=5 where the gcd(4,-3)=1. One
finds the solutions –
x = 2 + 3k and y = −1 − 4k with k = 0,±1,±2, etc.
That is we have the infinite number of integer solutions [x,y]={[5,-5],[8,-9],[2,-1],
etc}. A graph of these solutions looks like this-
Consider next the non-linear Diophantine equation-
y − x 2 = 10
By inspection one sees at once that two integer solution are [x,y]=[0,10] and [1,11].
What are the others? Its easy here to see if x=n then y=10+n2. Thus the solution in
parametric form becomes-
x = n and y = 10 + n 2 with n = 0,±1,±2,±3 y, etc
To generate a plot we use the MAPLE commandwith(plots):
pointplot({seq(n,10+n^2),n=-10..10}, symbol=circle, color=red);
This produces the graph-
Consider next the elliptic equation-
y 2 = x 3 + ax + b
and treat it as a non-linear Diophantine equation looking for integer solutions [x,y]
for integer values of the constants a and b. If we let x=n where n is an either positive
or negative integer, one gets that-
y = ± n 3 + an + b
The requirement for an integer y solution to exist is that the term in the radical
equals the square of an integer . This may or may not be possible depending on the
specific values of a and b. Let us consider the special case where a=-b=1. Here for
integer y to exist it is sufficient to have sqrt(n3+n-1) equal an integer. This clearly
occurs for n=1 where [x,y]=[1,1]. We can get other solutions by simply running
through all integers n=1,2,3,… and seeing if sqrt(n3+n-1) yields an integer. In the
range 1<n<300 we find only the points [1,±1], [2,±3], and [13,±47] , so apparently for
elliptic equations of this type the number of integer solutions remains finite. The
case of a=b=+1 apparently has no integer solutions . However, one notes that the
number of solutions will be infinite for the special case of a=b=0. There the solutions
may be expressed parametrically as-
x = n = k2
and
y = n 3 = k 3 with k = 0,±1,±2, etc
As the next Diophantine equation consider-
y 2 = x m + ax + b
with
m = 1, 2 ,3, 4 ,...
Here the integer solutions when a=b=0 will be-
x = n and
y = nm
for
n = 0,1,2,3,...
and hence are infinite in number. However this will no longer hold when a and b are
finite. Take the case of m=5 , a=1 and b=2. There we have-
y 2 = x5 + x + 2
Searching for values of n for which sqrt(n 5+n+2) is integer, we find just three
solutions [x,y]=[-1,0],[1,2] and [2,6].
Finally let us look at the formula 61x2+1=y2 studied by the Indian mathematician
Brahmagupta some 1382 year ago. We see that it is just a special form of the
hyperbola2
2
1
y x
=
=
1
−
where
a
and b = 1
b a
61
For integer solutions x=n we have the possible integer solution-
y=±
a 2
b + n2
b
Substituting in the values of a and b in Brahmagupta’s equation we find-
y = ± 1 + 61n 2
Besides the obvious solution [x,y]=[0,1] the next integer value is found numerically
to occur at the very large number-
x = 226153980 and
y = 1766319049
Fermat tried to come up with this integer solution but couldn’t. It was left to Euler
to do so. Neither of these mathematicians was familiar with Brahmagupta’s earlier
treatment.
The question is how did these earlier mathematicians come up with a solution to the
generalized form of Brahmagupta’s equation-
y 2 − K 2 x 2 = 1 where K 2 is a number
One way to solve this equation is to use the series expansion knowing that generally
Kx>>1. Such an expansion reads-
1
1
1⋅ 3
−
+
−
y = Kx 1 +
2
2
4
3
6
21
!
(
Kx
)
2
2
!
(
Kx
)
2
3
!
(
Kx
)
So taking , for example, K=sqrt(23), we get-
1
1
−
y = (4.79583152...) x 1 +
2
4
46 x 4232 x
+
From this it is clear that to get close to an integer for the term outside of the curly
bracket one needs x=5 which gives 5*sqrt(23)=23.979. Plugging this guess for x into
the full expansion we get y=sqrt(1+23·25)=sqrt(576)=24. So K=sqrt(23) yields the
lowest integer solution [x,y]=[5,24]. Take another case K=50. This time we try to
find an x such that x·sqrt(50)= 7.07106 ·x is close to an integer . We find
14·sqrt(50)=98.9949.. and so one can conclude that [x,y]=[14,99] will be an integer
solution. Checking, we find (99)2-50·(14)2=9801-9800=1 and things check out. To test
out the more difficult case of K=sqrt(61) which challenged Fermat and Euler, we
have x·7.810249676..=integer. One finds that x=226153980 produces the correct
integer value y=226153980·7.810249676=1766319049. Brahmagupta must have been
aware that K=sqrt(61) produces an especially large value for[x,y]. Solutions near
there such as for K=sqrt(60) and K=sqrt(62) produce as their lowest integer values
[x,y]= [4,31] and [8,63], respectively. Notice that the above equation can have no
integer solutions when K is an integer. This follows from the fact that the square of
an integer plus one is never equal to the square of another integer.
It is also possible to rewrite the generalized Brahmagupta equation as-
( y − Kx )( y + Kx ) = 1 so that y = Kx +
1
Kx + y
Continually re-substituting y, this last result may thus be re-written as the
continued fraction-
1
y = Kx +
1
2 Kx +
1
2 Kx +
2 Kx +
1
2 Kx +
For K=sqrt(2) where the lowest integer solution is [x,y]=[2,3] one has the continued
fraction expansion-
1
3=2 2+
1
4 2+
4 2+
1
4 2+
Looking for higher integer solutions for K=sqrt(2) one finds from an evaluation of
sqrt(1+2x2) the following tablex
y
2
3
12
70
17
99
408
2378
577
3363
13860
19601
80782
114243
470832
665857
2744210
3880899
15994428
22619537
93222358
131836323
543339720
768398401
You may wonder how I had the patience to find the integers in the last seven rows of
this table. The trick is that the ratios of xn/xn-1 and yn/yn-1 are found to be about
3+2sqrt(2)=5.828427.. for larger x and y values when a=1 and b=2. Thus one knows
approximately where to look for xn+1 and yn+1 and that y2n+1→ 2x2n+1 .
From the table one can also surmise that-
1
577 − 408 2 =
1
816 2 +
816 2 +
1
816 2 +
An interesting sidelight of the above series expansion is that one can write, upon
setting K to sqrt(N), that-
N=
1
1
1⋅ 3
Nx
1 + 1 1 2 − 2 2 4 + 3 3 6
y 1!2 N x 2!2 N x 3!2 N x
where x and y are integer solutions of the equation y2-Nx2=1. Just to show you that
this rapidly convergent series is correct, try the solution for N=371 for which the
lowest finite integer solution is x=88 and y=1695. It yields-
371 =
1
32648
− = 19.26136028...
1 +
1695 5746048
Another interesting expansion occurs for N=2 and the corresponding larger integer
solution x=70 and y=99. It produces-
1 ∞
(−1) n (2n)!
140
1
2=
+
∑
99 (140) 2 n = 0 (n!)(n + 1)!2 n (140) 2 n
which gives the very rapidly converging series-
2=
1
1
140
−
+
1 +
99 1!(140) 2 2!(140) 4
An even faster converging series is-
2=
1
27720
1 +
19601 (27720) 2
−
Just adding up the first two terms already yields a 17 place accurate value for the
sqrt(2).
Finally, I leave it for the reader to prove the following rapidly converging series for
the root of 17 . (Recall that 17 is encountered both in the connection with Gauss’s
heptadecagon and with the Fermat’s prime number 2^2^2+1)∞
1
(−1) n (2n)!
17 ⋅ 528
17 =
∑
1 +
2177 (2 ⋅17 ⋅ 5282 ) n = 0 n!(n + 1)!(4 ⋅17 ⋅ 5282 ) n
September 2010
© Copyright 2026 Paperzz