Bill Allombert on Mon, 23 May 2011 16:49:29 +0200


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

Re: numdiv() does not take advantage of addprimes()


On Sat, May 21, 2011 at 06:45:09PM +0400, Max Alekseyev wrote:
> numdiv() somehow does not take advantage of addprimes() - see example below.
> Is that intended?
> Max
> 
> ? addprimes([505471005740691524853293621])
> %1 = [505471005740691524853293621]
> ? factor(fibonacci(277))
> %2 =
> [505471005740691524853293621 1]
> 
> [6861121308187330908986328104917 1]
> 
> ? ##
>   ***   last result computed in 0 ms.
> ? numdiv(fibonacci(277))
> %3 = 4
> ? ##
>   ***   last result computed in 12,210 ms.

Hello Max, this was fixed in PARI 2.4.4-C27.
In traditional GP, addprimes was used to pretent that some hard-to-factor
composite numbers were primes, so they were not used for arithmetic functions
to avoid wrong results. Since it was mostly useless in new GP, we changed 
addprimes to store real primes.

Cheers,
Bill.