Bill Allombert on Mon, 05 Feb 2024 18:47:52 +0100


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

Re: nonprime(n)


On Mon, Feb 05, 2024 at 06:41:35PM +0100, Jean-Luc Arnaud wrote:
> Le 03/02/2024 à 18:33, Ruud H.G. van Tol a écrit :
> > for(n=1,2^18, prime(n));
> 
> Hi Ruud,
> 
> What kind of PC or Mac Monster do you own, which is able to calculate:
> 
>     ? for(n=1,2^18, prime(n));
>     cpu time = 1,516 ms, real time = 1,521 ms.
> 
> in 1.5 s, where my iMac does it in ... close to 4min? 😭😭
> 
>     cpu time = 3min, 38,881 ms, real time = 3min, 56,939 ms.

The trick is to start GP with -p257M so you already have the
prime number availabkle

%gp -q -p 257M
? for(n=1,2^18, prime(n));
? ##
  ***   last result: cpu time 1,198 ms, real time 1,198 ms.

Cheers,
Bill.