Euler's sum of powers conjecture: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
|||
Line 1,550: | Line 1,550: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
<syntaxhighlight lang="text"> |
<syntaxhighlight lang="text"> |
||
n = 250 |
|||
len p5[] n |
len p5[] n |
||
len h5[] 65537 |
len h5[] 65537 |
||
for i |
for i = 0 to n - 1 |
||
p5[i] = i * i * i * i * i |
p5[i + 1] = i * i * i * i * i |
||
h5[p5[i] mod 65537] = 1 |
h5[p5[i + 1] mod 65537 + 1] = 1 |
||
. |
. |
||
func search a s . y . |
func search a s . y . |
||
Line 1,562: | Line 1,563: | ||
while a + 1 < b |
while a + 1 < b |
||
i = (a + b) div 2 |
i = (a + b) div 2 |
||
if p5[i] > s |
if p5[i + 1] > s |
||
b = i |
b = i |
||
elif p5[i] < s |
elif p5[i + 1] < s |
||
a = i |
a = i |
||
else |
else |
||
Line 1,572: | Line 1,573: | ||
. |
. |
||
. |
. |
||
for x0 |
for x0 = 0 to n - 1 |
||
for x1 |
for x1 = 0 to x0 |
||
sum1 = p5[x0] + p5[x1] |
sum1 = p5[x0 + 1] + p5[x1 + 1] |
||
for x2 |
for x2 = 0 to x1 |
||
sum2 = p5[x2] + sum1 |
sum2 = p5[x2 + 1] + sum1 |
||
for x3 |
for x3 = 0 to x2 |
||
sum = p5[x3] + sum2 |
sum = p5[x3 + 1] + sum2 |
||
if h5[sum mod 65537] = 1 |
if h5[sum mod 65537 + 1] = 1 |
||
call search x0 sum y |
call search x0 sum y |
||
if y >= 0 |
if y >= 0 |
||
Line 1,589: | Line 1,590: | ||
. |
. |
||
. |
. |
||
. |
|||
</syntaxhighlight> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |