Function: addprimes
Section: number_theoretical
C-Name: addprimes
Prototype: DG
Help: addprimes({x=[]}): add primes in the vector x to the prime table to
 be used in trial division. x may
 also be a single integer. Composite "primes" are allowed,
 and in that case you may later get a message "impossible inverse", which
 will give you some factors. List the current extra primes if x is omitted. If
 some primes are added which intersect non trivially the existing table entries,
 suitable updating is done.
Doc: adds the integers contained in the
 vector $x$ (or the single integer $x$) to a special table of
 ``user-defined primes'', and returns that table. Whenever \kbd{factor} is
 subsequently called, it will trial divide by the elements in this table.
 If $x$ is empty or omitted, just returns the current list of extra
 primes.

 The entries in $x$ are not checked for primality, and in fact they need
 only be positive integers. The algorithm makes sure that all elements in
 the table are pairwise coprime, so it may end up containing divisors
 of the input integers.

 It is a useful trick to add known composite numbers, which the function
 $\kbd{factor}(x,0)$ was not able to factor. In case the message
 ``impossible inverse modulo $\langle$\var{some INTMOD}$\rangle$'' shows
 up afterwards, you have just stumbled over a non-trivial factor. Note
 that the arithmetic functions in the narrow sense, like \teb{eulerphi},
 do \emph{not} use this extra table.

 To remove primes from the list use \kbd{removeprimes}.
