Codes: part 52

#!/usr/bin/ruby
require ‘rational’
eval ”
a=0
while a <=18
a +=1
x=0
while x <=8
x +=1
d=a**x

b=0
while b <=19
b +=1
y=0
while y <=14
y +=1
e=b**y

if d!=e
f=d+e

c=0
while c <=131
c +=1
z=0
while z <=9
z +=1
g=c**z

if d!=g
if e!=g
if f==g
if a<=b
if a.gcd(b)==1
if b.gcd(c)==1
if c.gcd(a)==1
if y*z+z*x+x*y<x*y*z
print ”, f, ‘ = ‘,”, a,’^’,”,x,’ + ‘,”,b,’^’,”,y,’ = ‘,”,c,’^’,”,z,’\n’
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end


Advertisements