function [ n ] = inverseFactorial( f )
%INVERSEFACTORIAL Find the smallest integer n such that n! >= f.

% Count up through possible n values until finding the first whose
% factorial equals or exceeds f.

n = 1;

while factorial(n) < f
    n = n + 1;
end

end
