Practical fast primality test

74 Views Asked by At

I want to test the primality of some numbers. To do this I have tried PARI/GP and from the command line:

isprime(1797985968535216664944496004358374343509215681442061471412191560717902567100922783048272325884204171542595289833292525444657649015706240748603258905587228070218364321463272748372578381297752753873677472254922355241777152285815968419478586580462607181532633401390493324158696274873236811462980002924358959014961523858527582932580094707941486443910926176542073077556968436127272895058310597583607027726718736469175668307253909021323053371430188118304785898711275203434771737000724872573886880637420519724444463284443388727630283664666528052367541776313661585262983733024993681478681073098831498512514689575760815626512236554172414169581755726459092026691025970210757809328265617410698278014699792075882575574349505687630013946351950460669539772156003437151693004013771313802959350891175251984857136050528938291210156109810918641191927163139067163195482729770659833966232718210585298243545222708068057806276615307574921733035321516850527615134840300065761)

took about $90$ seconds to return $1$ (prime).

Are there options with PARI/GP or other software to make the computation faster, for numbers with $1000$ digits like the one above or even more?

EDIT

I have found a PARI/GP function ispseudoprime which is much faster and meets my needs for a first evaluation, i.e. I could run isprime only when ispseudoprime returns $1$. Anyway it would be nice to know about other alternatives.

1

There are 1 best solutions below

2
On

Mathematica returns the answer in milliseconds:

Timing[PrimeQ[179...761]]
{0.055672, True}