4 lines
57 B
Ruby
4 lines
57 B
Ruby
|
def series(n)
|
||
|
(1..n).map { |x| x ** x }.inject(:+)
|
||
|
end
|