An efficient method for calculating cutoff frequencies in optical fibers with arbitrary index profiles