Bill Allombert on Wed, 19 Apr 2023 19:29:05 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Factoring Carmichael Numbers


On Wed, Apr 19, 2023 at 02:11:03AM +0200, Paul Underwood wrote:
> All timings were done on a single core of a 1.7GHz Celeron laptop with 1GB of
> memory allocated. For the 3808 digit number [1] with 662 factors:
> 23.0 seconds using Pari/GP's factor().
> 21.6 seconds using the above code.
> 
> For the 43779 digit number [1] with 5616 factors 5,443.5 seconds. The
> function factor() ran out of memory after 21 hours and did not complete the
> task it was given.

Hello Paul,

The reason PARI is slow is that it does a primality test each time it finds a factor.
Since the number is large with lots of factors, then it takes a long time.
(about 90s for each factor). So it should finish in about 54 hours.

If we expected that the number do not have prime factors larger than some bounds, we
could just skip the primality test.

For 662.txt, it would finish in less than 5 seconds.
For 5616.txt, it would take 7h, 6min, 216 ms.

Cheers,
Bill