factor - Getting prime factors
This function uses the simple sieve approach. It may require large memory allocation if the number given is too big. Technically it is possible to improve this algorithm, allocating less memory for most cases and resulting in a faster execution time. However, it will still have problems in the worst case, so we choose to impose an upper bound on the input number and error out for n > 2^32. This function has been imported from MatLab.
pfc=factor(102); disp(pfc);
isprime ,