mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2004-02-11, 03:27   #1
jocelynl
 
Sep 2002

2·131 Posts
Default aks algorithm and polynomial

I was looking at the AKS alogorithm
and notice that i'm not familiar with polynomial modulus
Here is the algorithm.
I need some help with

if ( (x-a)^n is not (x^n-a) (mod x^r-1,n) ) then output COMPOSITE

I don't see what the ,n does?

Code:
Input: Integer n > 1

if (n has the form ab with b > 1) then output COMPOSITE

r := 2
while (r < n) {
	if (gcd(n,r) is not 1) then output COMPOSITE
	if (r is prime greater than 2) then {
 		let q be the largest factor of r-1
		if (q > 4sqrt(r)log n) and (n^((r-1)/q) is not 1 (mod r)) then break
	}
	r := r+1
}

for a = 1 to 2sqrt(r)log n {
	if ( (x-a)^n is not (x^n-a) (mod x^r-1,n) ) then output COMPOSITE
}

output PRIME;

Joss
jocelynl is offline   Reply With Quote
Old 2004-02-11, 05:20   #2
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

2×137 Posts
Default

Joss,

I'm not that familiar with it either, but I tried interpreting it in different ways, then coding a crude program to test it.
Quote:
if ( (x-a)^n is not (x^n-a) (mod x^r-1,n) ) then output COMPOSITE
The only interpretation which produced the correct results was:
Raise (x - a) to the nth power,
(mod x^r-1) means (mod r) on the powers of x, which results in adding the x^(r+i) term to the x^i term.
Do the (mod n) on the individual coefficients.

The foundation of the method is that if you raise (x - a) to a prime n, all the coefficients will be either 1 or divisible by n.
(The nth row of pascals triangle contains only multiples of n for prime n.) When you do (mod n), you get 1, 0, 0, ..., 0, a
-- which is (x^n-a).

The problem is you're working with n terms, which is too slow for large n. The genius of AKS is, for certain values of r, if you restrict yourself to r terms -- wrapping the rest around -- the coefficients will still be divisible by n for prime n, and divisible by some factor of composite n. That is what all their high math language was proving.

Hope this helps,

Maybeso
Maybeso is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Polynomial Discriminant is n^k for an n-1 degree polynomial carpetpool Miscellaneous Math 14 2017-02-18 19:46
Polynomial algorithm diep Factoring 7 2012-09-29 12:09
TF algorithm(s) davieddy Miscellaneous Math 61 2011-07-06 20:13
Polynomial R.D. Silverman NFSNET Discussion 13 2005-09-16 20:07
AKS - A polynomial-time algorithm for testing primality. Maybeso Math 11 2002-11-20 23:39

All times are UTC. The time now is 17:41.


Fri Jul 16 17:41:47 UTC 2021 up 49 days, 15:29, 1 user, load averages: 1.20, 1.38, 1.46

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.