Euler's sum of powers conjecture: Difference between revisions

Content added Content deleted
(Added FreeBasic and Minimal BASIC)
Line 2,317: Line 2,317:
len h5[] 65537
len h5[] 65537
for i = 0 to n - 1
for i = 0 to n - 1
p5[i + 1] = i * i * i * i * i
p5[i + 1] = i * i * i * i * i
h5[p5[i + 1] mod 65537 + 1] = 1
h5[p5[i + 1] mod 65537 + 1] = 1
.
.
proc search a s . y .
func search a s .
y = -1
y = -1
b = n
b = n
while a + 1 < b
while a + 1 < b
i = (a + b) div 2
i = (a + b) div 2
if p5[i + 1] > s
if p5[i + 1] > s
b = i
b = i
elif p5[i + 1] < s
elif p5[i + 1] < s
a = i
a = i
else
else
a = b
a = b
y = i
y = i
.
.
.
.
return y
.
.
for x0 = 0 to n - 1
for x0 = 0 to n - 1
for x1 = 0 to x0
for x1 = 0 to x0
sum1 = p5[x0 + 1] + p5[x1 + 1]
sum1 = p5[x0 + 1] + p5[x1 + 1]
for x2 = 0 to x1
for x2 = 0 to x1
sum2 = p5[x2 + 1] + sum1
sum2 = p5[x2 + 1] + sum1
for x3 = 0 to x2
for x3 = 0 to x2
sum = p5[x3 + 1] + sum2
sum = p5[x3 + 1] + sum2
if h5[sum mod 65537 + 1] = 1
if h5[sum mod 65537 + 1] = 1
call search x0 sum y
y = search x0 sum
if y >= 0
if y >= 0
print x0 & " " & x1 & " " & x2 & " " & x3 & " " & y
print x0 & " " & x1 & " " & x2 & " " & x3 & " " & y
break 4
break 4
.
.
.
.
.
.
.
.
.
.
.
.
</syntaxhighlight>
</syntaxhighlight>