Euler's sum of powers conjecture: Difference between revisions
→{{header|Raku}}: superscript in code, sigil-less, no temp. var, remove superfluous brackets, consolidate short-circuit tests
(changing formatting in the intro) |
SqrtNegInf (talk | contribs) (→{{header|Raku}}: superscript in code, sigil-less, no temp. var, remove superfluous brackets, consolidate short-circuit tests) |
||
Line 3,521:
=={{header|Raku}}==
(formerly Perl 6)
{{trans|Python}}<syntaxhighlight lang="raku" line>constant MAX = 250;
my %po5{Int};
my %sum2{Int};
%po5{
for 1..MAX ->
%sum2{
}
}
for %
▲ say ((sort |%sum2{$s}[],|%sum2{$p-$s}[]) X~ '⁵').join(' + ') ~ " = %po5{$p}" ~ "⁵";
}
}
}</syntaxhighlight>
{{out}}
<pre>27⁵ + 84⁵ + 110⁵ + 133⁵ =
=={{header|REXX}}==
=== fast computation ===
|