2. Motivation
In a seminal paper[1], Agrawal et al. put forward a conjecture
which if true would reduce the complexity of their primality testing
algorthim by a signicant amount. The conjecture, which is due to
Bhattacharjee and Pandey[3], is as follows
Conjecture
If r is a prime number that does not divide n and if
( X − 1)n ≡ X
n − 1( mod X
r − 1, n)
Then either n is prime or n
2
≡ 1( mod r )
However, a heuristic to construct a class of counterexamples for
this conjecture was given by H.W Lenstra and Carl Pomerance[2].
3. The proposition given by Lenstra and Pomerance is as follows
Proposition
Let p1, p2, . . . pk be k distinct primes and let n = p1 . . . pk.
Suppose that
1. k ≡ 1( mod 4)
2. pi ≡ 3( mod 80) for all i
3. ( pi − 1) |( n − 1) for all i
4. ( pi + 1) |( n + 1) for all i
Then
( X − 1)n ≡ X
n − 1( mod n, X
5
− 1)
We generalize their arguments to give heuristics for more
counterexamples.
4. Generalizing r
We prove that the previous proposition is not just true for the
number 5, but generalizes to any number r ≡ 1( mod 4), the
proposition is as follows
Proposition
Let p1, p2, . . . pk be k distinct primes, let n = p1 . . . pk and let r be
a prime number such that r ≡ 1( mod 4) and r | n. Suppose that
1. k ≡ 1( mod 4)
2. p
2
i ≡ −1( mod 16r ) for all i
3. ( pi − 1) |( n − 1) for all i
4. ( pi + 1) |( n + 1) for all i
Then
( X − 1)n ≡ X
n − 1( mod n, X
r − 1)
5. Sketch of proof
By assumption, we have n
2
= ( p1p2 . . . pk)2
≡ ( −1)k( mod 16r ).
Hence n
2
≡ −1( mod r ), so n
2
≡ 1( mod r ).
Now in order to prove the identity
( X − 1)n ≡ X
n − 1( mod X
r − 1, n)
it suces to prove the identity ( X − 1)n ≡ X
n − 1( mod Φ(x ), n)
where Φ(x ) is the rth cyclotomic polynomial.
By the Chinese Remainder Theorem and cyclotomic extensions, we
have the following isomorphisms
Zn[X ] / Φ(x ) ∼=
k
i=1
Zpi [X ] / Φ(x ) ∼=
k
i=1
Zpi (ζr)
where ζr is the rth primitive root of unity.
6. Therefore proving that ( X − 1)n ≡ X
n − 1 in the eld Zpi (ζr) for
all i = 1 . . . k .
becomes equivalent to proving that
(ζr − 1)n ≡ ζn
r − 1( mod pi)
for all i = 1 . . . k
Denoting pi := p, we note that
(ζr − 1)p2
= ζp2
r − 1
= ζ−1
r − 1
= −ζ−1
r (ζr − 1)
(ζr − 1)2(p2−1)
= ζ−1
r
(ζr − 1)2r(p2−1)
= 1
7. Therefore
(ζr − 1)n ≡ ζn
r − 1( mod pi)
will hold if
n ≡ pi ( mod 2r (p
2
i − 1))
for all i = 1 . . . k . But for this to happen, we must have the
following divisibility conditions
16r | n − pi
pi − 1
2
| n − pi
pi + 1
4
| n − pi
But these hold trivially, from the assumptions of the proposition.
Hence we're done and the assumptions we've made are the
heuristics for counterexamples to the Agrawal conjecture.
8. Generalizing n to a product of distinct primes
We give a similar proposition that generalizes the structure of n
from simply a product of distinct primes to a product of powers of
distinct primes.
Proposition
Let p
a1
1
, p
a2
2
. . . p
ak
k be k distinct prime powers, let
n = p
a1
1
p
a2
2
. . . p
ak
k . Suppose that
1. k ≡ 1( mod 4)
2. ai ≡ 1( mod 4) for all i = 1 . . . k
3. 10 | ( p
a1
1
p
a2
2
. . . p
ai−1
i−1
p
ai+1
i+1
. . . p
ak
k − 1) for all i = 1 . . . k
4. ∃ ti such that ti ≡ 2( mod 4) and
(p
ti
i − 1) | ( p
a1
1
p
a2
2
. . . p
ai−1
i−1
p
ai+1
i+1
. . . p
ak
k ) − 1 for all i = 1 . . . k
5. pi ≡ 3( mod 20) for all i = 1 . . . k
Then
(X − 1)n ≡ X
n − 1( mod n, X
5
− 1)
9. Sketch of proof
By assumption, we have n
2
= (p
a1
1
p
a2
2
. . . p
ak
k )2
≡ ( 9)k( mod 20).
Hence n
2
≡ ( −1)k( mod 5), which implies that n
2
≡ −1( mod 5),
so n
2
≡ 1( mod 5).
By the CRT and cyclotomic extensions, we have the following
isomorphism
Zn[X ] / Φ5(x ) ∼=
k
i=1
Zpai
i
[X ] / Φ5(x ) ∼=
k
i=1
Zp
ai
i
(ζ5)
Thus proving that ( X − 1)n ≡ X
n − 1 in the eld Zpai
i
(ζ5) for all
i = 1 . . . k is equivalent to proving that
(ζ5 − 1)n ≡ ζn
5 − 1( mod p
ai
i )
for all i = 1 . . . k
10. We note that
(ζ5 − 1)pti
i = ζ
pti
i
5
− 1
= ζ−1
5
− 1
= −ζ−1
5
(ζ5 − 1)
(ζ5 − 1)2(pti
i −1)
= ζ−1
5
(ζ5 − 1)10(pti
i −1)
= 1
for all ti, i = 1 . . . k as assumed by the proposition. It is clear that
the order of the element (ζ5 − 1) divides the number 10(p
ti
i − 1).
Therefore to prove that (ζ5 − 1)n ≡ ζn
5
− 1( mod p
ai
i ) for all
i = 1 . . . k , it is sucient to show that
n ≡ p
ai
i ( mod 10(p
ti
i − 1))
p
ai
i ( p
a1
1
p
a2
2
. . . p
ai−1
i−1
p
ai+1
i+1
. . . p
ak
k − 1) ≡ 0( mod 10( p
ti
i − 1))
for all i = 1 . . . k
11. In order for this to hold, p
a1
1
p
a2
2
. . . p
ai−1
i−1
p
ai+1
i+1
. . . p
ak
k − 1 must be
divisible by the pairwise co-prime numbers 20,
pti
i −1
2
, i.e we must
have
20 | p
a1
1
p
a2
2
. . . p
ai−1
i−1
p
ai+1
i+1
. . . p
ak
k − 1
p
ti
i − 1
2
| p
ai−1
i−1
p
ai+1
i+1
. . . p
ak
k − 1
However these hold trivially due to the assumptions made in the
proposition. Hence the proposition is proved and we have another
set of heuristics for counterexamples to Agrawal's conjecture.
12. A rough estimate for the number of counterexamples
suggested by one of the propositions
Consider again the following
Proposition
Let p1, p2, . . . pk be k distinct primes, let n = p1 . . . pk and let r be
a natural number such that r ≡ 1( mod 4). Suppose that
1. k ≡ 1( mod 4)
2. p
2
i ≡ −1( mod 16r ) for all i
3. ( pi − 1) |( n − 1) for all i
4. ( pi + 1) |( n + 1) for all i
Then
( X − 1)n ≡ X
n − 1( mod n, X
r − 1)
We now outline an argument that provides a rough estimate of the
number of counterexamples of this form within a chosen interval.
13. The argument
Fix some arbitrarily large integer m and let T be very large. Let
P = Pm(T ) denote the set of primes p in the interval [T , T
m] such
that:
1. p ≡ 3(mod 8r ), where r ≡ 1(mod 4) and r is prime;
2. p−1
2
is squarefree and divisible only by primes q ≤ T with
q ≡ 3(mod 4);
3. p+1
4
is squarefree and divisible only by primes r ≤ T with
r ≡ 1(mod 4).
Clearly, a fraction of all primes(asymptotically) in [T , T
m] satisfy
condition 1, we can also prove similarly that a positive fraction of
primes in [T , T
m] are such that p−1
2
and p+1
4
are squarefree. The
event that every prime in (p − 1)/2 is 1(mod 4) should occur with
probability c (logT )−1/2
, and similarly for every prime in p + 1/4 to
be 3(mod 4) [4], where c is Landau's constant. Thus as T → ∞,
the cardinality of Pm(T ) should asymptotically be
cT
m / log
2
T
where c is a positive constant that depends on the choice of m.
14. We now choose k such that k ≡ 1(mod 4) and k T
2
/(log T
m)
and we form the squarefree numbers n that run over products of k
distinct primes of the set P . The number of choices for n is exactly
given by the binomial coecient #P
k , and we get the lower bound
#P
k
≥
T
m
(logT
m)3
(T
2
/logT
m)
(T2/logTm)−4
(T
m−3
)(T2/logTm)−4
= e
(1−3/m)T2−4(m−3)logT
e
1−(4/m)T2
for suciently large T and a xed n.
15. Let Q denote the the product of primes q ≤ T with q ≡ 3(mod 4)
and let R denote the product of primes r ≤ T with r ≡ 1(mod 4).
Then Q and R are relatively coprime so that QR e
2T for a large
T . Thus the number of choices for n that satisfy both
n ≡ 1(mod Q) and n ≡ −1(mod R ) should be
e
(1−4/m)T2
e
−2T e
T2(1−5/m)
Thus we see that for ay xed n and for large T , there should be
atleast e
T2(1−5/m) counterexamples to Agrawal's conjecture below
e
T2
.
16. References
Agrawal, Manindra, Neeraj Kayal, and Nitin Saxena. PRIMES
is in P . Annals of mathematics (2004): 781-793.
H.W Lenstra, Carl Pomerance, Future directions in algorithmic
number theory, ARCC workshop held at Paolo Alto, Californua,
March 2008
Bhattacharjee, Rajat, and Prashant Pandey. Primality testing.
Technical report, IIT Kanpur, 2001.
Landau, Edmund. Über die Einteilung der positiven ganzen
Zahlen in vier Klassen nach der Mindestzahl der zu ihrer
additiven Zusammensetzung erforderlichen Quadrate. 1909.