% EX2 a)

function a = convert2basis(n, b)
    if (b < 2)
        disp('basis needs to be at least 2!')
        return
    end
    
    v = [];

    while n > 0
        v = [mod(n, b), v];
        n = floor(n / b);
    end

    a = v
end
