Euler's sum of powers conjecture: Difference between revisions
Content added Content deleted
(Euler's sum of powers conjecture in various dialects BASIC (BASIC256, True BASIC and Yabasic)) |
(Initial FutureBasic task solution added) |
||
Line 2,574: | Line 2,574: | ||
{{out}} |
{{out}} |
||
<pre> 27 84 110 133 144</pre> |
<pre> 27 84 110 133 144</pre> |
||
=={{header|FutureBasic}}== |
|||
<syntaxhighlight lang="futurebasic"> |
|||
void local fn EulersSumOfPower( max as int ) |
|||
long w, x, y, z, sum, s1 |
|||
for w = 1 to max |
|||
for x = 1 to w |
|||
for y = 1 to x |
|||
for z = 1 to y |
|||
sum = w^5 + x^5 + y^5 + z^5 |
|||
s1 = int(sum^0.2) |
|||
if ( sum == s1 ^ 5 ) |
|||
print w;"^5 + ";x;"^5 + ";y;"^5 + ";z;"^5 = ";s1;"^5" |
|||
exit fn |
|||
end if |
|||
next |
|||
next |
|||
next |
|||
next |
|||
end fn |
|||
fn EulersSumOfPower( 250 ) |
|||
HandleEvents |
|||
</syntaxhighlight> |
|||
{{output}} |
|||
<pre> |
|||
133^5 + 110^5 + 84^5 + 27^5 = 144^5 |
|||
</pre> |
|||
=={{header|Go}}== |
=={{header|Go}}== |