Problem 30

Perl6

1say [+] (2..350000).grep({([+] $_.comb.map(* ** 5)) == $_})
Ruby
1elems = []
2(2..500000).map{|n| num = n; n = n.to_s.split('').map(&:to_i);
3                sum = 0
4               n.each{|x| sum += x ** 5}
5               if num == sum
6                   elems.push(num)
7               end
8}
9puts elems.reduce(:+)