> 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/m/munchausen_numbers.md).

# Munchausen numbers

```ruby
func is_munchausen(n) {
    n.digits.map{|d| d**d }.sum == n
}
 
say (1..5000 -> grep(is_munchausen))
```

#### Output:

```
[1, 3435]
```
