CoCoA:SmoothFactor

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

SmoothFactor

find small prime factors of an integer

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]
-------------------------------

Syntax

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

IsPrime

IsPPrime

   <type>int</type>
   <type>list</type>