function is_even(n::Int)
    return n % 2 == 0
end

function is_odd(n::Int)
    return n % 2 != 0
end

function collatz_steps(n::Int)
    if n <= 0
        throw(DomainError("Input must be a positive integer."))
    end
    steps = 0
    while n != 1
        if is_even(n)
            n ÷= 2
        else
            n = 3 * n + 1
        end
        steps += 1
    end
    return steps
end