Home

Permutations and Fermat’s Theorem

Let us define the Fermat Equation as

xn+yn =zn                                             (1)

where y, z and n are integers:

n>2,                             (2)

1<x<y<z.                      (3)

In this case xn, yn and zn are all integers. But according to Fermat’s Theorem, x cannot be an integer when n>2. In such cases xn is an integer whose n’th root is always non-integer.

We begin by assuming that x is an integer, and show why Fermat was right in cases where n>2.

In testing Fermat’s Theorem on a computer, values must be given to all permutations of x, y and z up to a large but finite limit.

Given a value of n=2, we begin by computing up to the first billion permutations of x, y and z using the following algorithm:

for x=2 to 1000

for y=x+1 to x+1+ 1000

for z=y+1 y+1+to 1000

Permutation(x,y,z)={x,y,z}

next z

next y

next x

Let us now define a Sum for each of these 1 billion Permutations:

Sum(x,y,z)=zn-yn-xn.                     (4)

In any case where it is found that sum=0, x is an integer.

Program (A) computes Permutations {x,y,z} for the first ten instances of Sum=0. The results are displayed in Table (1) with n=2.

Table 1

Perm               x             y              z

 996004 3 4 5 1993969 5 12 13 2483529 6 8 10 2991808 7 24 25 3474516 8 15 17 3962101 9 12 15 3989385 9 40 41 4463445 10 24 26 4986516 11 60 61 5431747 12 16 20

Note that, when n=2, there are Permutations where Sum=0 … a result well known by the ancient Greek, Pythagoras.

We now consider the case where n=3. The result is that no zero sums are computed … not in a single one of the first billion permutations! Should we insist that an infinite number of permutations must be checked before concluding that Fermat was correct? A mathematical purist might insist that we must … obviously impossible on a computer. A physicist might argue “No, computing Sum for a billion permutations suffices”, since there are not an infinite number of electrons in the entire universe!

Cases where n>3 can easily be checked using Program (A). In every such case Fermat is corroborated.

A final comment regarding mathematical purity may be in order. Mathematician Andrew Wiles has derived a proof that Fermat’s Theorem is correct for all possible permutations of x, y and z, where the number of permutations is infinite. His proof is reportedly over 200 pages long and invokes ideas unknown in Fermat’s day. Fermat claimed, in a celebrated marginal note, that he had an elegant brief proof. But such a proof was never published, nor was it found among his working papers following his death. And of course he had no computer with which to test a billion or more permutations. All things considered, his so-called “theorem” has been reclassified by many to be a conjecture, much as the extrapolation to infinite permutations in this monograph is a conjecture. In the centuries since Fermat’s death, many (including yours truly) have sought his professed simple proof. To date none has been found.

Program 1

#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN () AS LONG
DIM n AS LONG
'Change n to value >2 as desired. Then run program.
n=3
DIM limit AS LONG
limit=1000
DIM Hits AS LONG
OPEN "c:\users\marjorie dixon\documents\plotsiteration.dat" FOR OUTPUT AS #1
OPEN "c:\users\marjorie dixon\documents\plotssum.dat" FOR OUTPUT AS #2
OPEN "c:\users\marjorie dixon\documents\plotsx1.dat" FOR OUTPUT AS #3
OPEN "c:\users\marjorie dixon\documents\plotsy1.dat" FOR OUTPUT AS #4
OPEN "c:\users\marjorie dixon\documents\plotsz1.dat" FOR OUTPUT AS #5
CLOSE 1
CLOSE 2
CLOSE 3
CLOSE 4
CLOSE 5
OPEN "c:\users\marjorie dixon\documents\plotsiteration.dat" FOR APPEND AS #1
OPEN "c:\users\marjorie dixon\documents\plotssum.dat" FOR APPEND AS #2
OPEN "c:\users\marjorie dixon\documents\plotsx1.dat" FOR APPEND AS #3
OPEN "c:\users\marjorie dixon\documents\plotsy1.dat" FOR APPEND AS #4
OPEN "c:\users\marjorie dixon\documents\plotsz1.dat" FOR APPEND AS #5
Hits=0
Perm=0
FOR x=1 TO limit
FOR y=x+1 TO x+1+limit
FOR z=y+1 TO y+1+limit
sum=z^n-y^n-x^n
IF sum=0 THEN
hits=hits+1
IF hits>10 THEN
GOTO EndIT
END IF
END IF
IF sum=0 THEN
WRITE #1,Perm
WRITE #2,sum
WRITE #3,x
WRITE #4,y
WRITE #5,z
END IF
Perm=Perm+1
NEXT z
NEXT y
NEXT x
EndIT:
MSGBOX("Hits=" & STR\$(Hits))
MSGBOX("Permutations=" & STR\$(Perm))
CLOSE 1
CLOSE 2
CLOSE 3
CLOSE 4
CLOSE 5