Does PARI/GP have a function for finding the smallest prime factor of a t_INT
or otherwise perform a partial factorization of an integer?
For example, if I have the number:
a=261432792226751124747858820445742044652814631500046047326053169701039080900441047539208779404889565067
it takes a long time to do factor(a)
because a
contains two huge prime factors. However, it is quite easy to find that 17
is a divisor of a
.
Of course in this case I could have used just forprime(p=2,,a % p == 0 && return(p))
or a similar trial division to find the factor. But if the least factor had had 20 decimal figures, say, that would be impractical, and I might have wanted to use the sophisticated methods of factor
in that case.
So it would be ideal if I could call factor
with some kind of flag saying I will be happy with any partial factorization, or saying that all I care about is the smallest non-trivial divisor, etc.