> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/e/eulers_sum_of_powers_conjecture.md).

# Euler's sum of powers conjecture

```perl
constant MAX = 250;

my  %po5{Int};
my %sum2{Int};

for 1..MAX -> \i {
    %po5{i⁵} = i;
    for 1..MAX -> \j {
        %sum2{i⁵ + j⁵} = i, j;
    }
}

%po5.keys.sort.race.map: -> \p {
    for %sum2.keys.sort -> \s {
        if p > s and %sum2{p - s} {
            say ((sort |%sum2{s},|%sum2{p - s}) X~ '⁵').join(' + '), " = %po5{p}", "⁵" and exit
        }
    }
}
```

#### Output:

```
27⁵ + 84⁵ + 110⁵ + 133⁵ = 144⁵
```
