> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/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/sidef-lang/programming_tasks/d/distinct_power_numbers.md).

# Distinct power numbers

```ruby
[2..5]*2 -> cartesian.map_2d {|a,b| a**b }.sort.uniq.say
```

Alternative solution:

```ruby
2..5 ~X** 2..5 -> sort.uniq.say
```

## Output:

```
[4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125]
```
