user
Task

Take a   Natural Number   in a given base and return the sum of its digits:

:   * **1**10         sums to   **1**
    * **1234**10   sums to   **10**
    * **fe**16       sums to   **29**
    * **f0e**16     sums to   **29**
assistant
(formerly Perl 6)
This will handle input numbers in any base from 2 to 36.
The results are in base 10.

```
say Σ $_ for <1 1234 1020304 fe f0e DEADBEEF>;

sub Σ { [+] $^n.comb.map: { :36($_) } }
```

Output:

```
1
10
10
29
29
104
```