up previous next
SmoothFactor

find small prime factors of an integer
Syntax

SmoothFactor(N:INT, MaxP:INT):[LIST of INT, INT]



Description
This function finds the small prime factors of an integer. It simply tries dividing by all primes up to the given bound. The result is a list of the prime factors found together with the unfactored part of N. Be careful about supplying large values for MaxP (e.g. greater than a million): the function could take a very long time. MaxP must be positive.

Example
  SmoothFactor(100,3);
[[2, 2], 25]
-------------------------------
  SmoothFactor(123456789,3700);
[[3, 3, 3607, 3803], 1]
-------------------------------



See Also