euler/ruby/euler048.rb

4 lines
57 B
Ruby
Raw Normal View History

2014-11-19 22:50:42 +00:00
def series(n)
(1..n).map { |x| x ** x }.inject(:+)
end