0 do 1..n |> Enum.map(&fizzbazz/1) end defp fizzbazz(n) do cond do rem(n, 3) == 0 and rem(n, 5) == 0 -> “FizzBazz” rem(n, 3) == 0 -> “Fizz” rem(n, 5) == 0 -> “Bazz” true -> n end end end iex(5)> FizzBazz.upto(16) [1, 2, "Fizz", 4, "Bazz", "Fizz", 7, 8, "Fizz", "Bazz", 11, "Fizz", 13, 14, "FizzBazz", 16]