Package: pari
Version: 2.6.1

Reading GPRC: gprc.txt ...Done.

GP/PARI CALCULATOR Version 2.6.1 (alpha)
i686 running mingw (ix86/GMP-5.0.1 kernel) 32-bit version
compiled: Sep 20 2013, gcc version 4.6.3 (GCC)
(readline v6.2 enabled, extended help enabled)

Copyright (C) 2000-2013 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes
WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 4000000, primelimit = 500000
(19:23) gp > \l prime
logfile = "prime"
log = 1 (on)
(19:24) gp > isprime(100000982717289000001)
%1 = 0
(19:25) gp > isprime(100000982717289000001,0)
%2 = 0
(19:25) gp > isprime(100000982717289000001,1)
%3 = 0
(19:25) gp > isprime(100000982717289000001,2)
%4 = 1
(19:25) gp > isprime(100170437171734071001)
%5 = 0
(19:26) gp > isprime(100170437171734071001,0)
%6 = 0
(19:26) gp > isprime(100170437171734071001,1)
%7 =
[ 2 7 1]

[ 3 3 1]

[ 5 3 1]

[ 751 2 1]

[14820304360369 2 1]

(19:26) gp > isprime(100170437171734071001,2)
%8 = 1
(19:27) gp > factor(100170437171734071001)
%9 =
[100170437171734071001 1]

(19:28) gp > ?isprime
isprime(x,{flag=0}): true(1) if x is a (proven) prime number, false(0) if not.
If flag is 0 or omitted, use a combination of algorithms. If flag is 1, the
primality is certified by the Pocklington-Lehmer Test. If flag is 2, the
primality is certified using the APRCL test.

Both proven primes i.e. 100000982717289000001 and 100170437171734071001 are shown as false by isprime() function with flag 0 and omitted flag. With flag 2 both are shown as proven primes which is correctly the case. With flag 1 the number 100170437171734071001 with isprime function shows
[ 2 7 1]

[ 3 3 1]

[ 5 3 1]

[ 751 2 1]

[14820304360369 2 1]
Can you explain or rectify the bug?


Shyam Sunder Gupta
www.shyamsundergupta.com