defmodule Main do def main do n = IO.gets("") |> String.trim |> String.to_integer sum_numbers(n) end defp sum_numbers(max) do for x <- 0..max do x end |> Enum.reduce(&(&1 + &2)) end end