Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

new user here. Where does a layman go to get a basic understanding of AKS primality testing. I am not talking about the optimal choice of "r" (which I am told is the hardcore number theoretic part of the algorithm). I mean basic things, like what does "mod(n, x^r-1)" mean (how can something be mod two things?) And what does binomial expansion have to do with anything. I can't find anything in Wikipedia that is appropriate for my level. Thanks.

share|cite|improve this question
Please tell us more about "your level". Do you know about congruence arithmetic and/or the ring of integers modulo m, and, if so, are you familiar with polynomials over such rings? – Bill Dubuque Jul 18 '11 at 18:01
@Gary: If you will ask specific questions here, we can address them directly as well. – mixedmath Jul 18 '11 at 18:33
I know about integers modulo m, but not polynomials. – Gary Jul 18 '11 at 19:54
Thank you all. Very helpful responses. – Gary Jul 19 '11 at 16:50

I will address the two question that are directly stated. If you ask more, I can change this answer.

To mod by two things, in this case a number and a polynomial, is not as bad as it might seem. Modding by the number n is just as before - treat every coefficient separately. So $16x^2 + 10x + 7 \equiv x^2 + 2 \mod 5$. The polynomial modulus is a little stranger. But in the case where it's $x^k - 1$, this just means that you reduce all exponents greater than $k$ by $k$, effectively dividing polynomials that are "too large" by a smaller polynomial.

Many more sources exist. Here is a great primer. This is a short FAQ aimed at the AKS. And here is a list of other sources or learning about the AKS algorithm.

share|cite|improve this answer

Informally $\rm\:(mod\ n,\ x^r - 1)\:$ denotes polynomial arithmetic mod assumptions $\rm\:n = 0,\ x^r -1 = 0\:.\:$ Using these assumptions we can reduce an integer coefficient polynomial to normal form form as follows. Reduce all coefficients mod $\rm\:n\ $ and then substitute $\rm\:x^r = 1\:,\ $ so $\rm\ x^{r+1} =x,\:\ x^{r+2} = x^2,\ \ldots,\:$ Notice that this is equivalent to replacing all of the exponents of $\rm\:x\:$ by their remainders $\rm\:(mod\ r)\:.\ $ This yields a polynomial of degree $\rm < r\:$ with coefficients between $0$ and $\rm\:n-1\:.\:$ Two polynomials are congruent $\rm\:(mod\ n,\ x^r-1)\:$ iff they have the same reduced normal forms (or, equivalently, if their difference reduces to $0\:$). This reduction is the same as using the the Division Algorithm to reduce a polynomial by mapping it to its remainder after division by $\rm\: x^r-1\:,\:$ doing coefficient arithmetic $\rm\:mod\ n\:,\:$ i.e. considering the polynomials as being over the ring $\rm\:\mathbb Z/n =\: $ integers $\rm\:(mod\ n)\:.\:$

share|cite|improve this answer
Could you please give a numerical example of reducing a polynomial? Better yet, could you please give a detailed example of an AKS proof? Or point to one somewhere on the internet? – user448810 Sep 28 '12 at 1:18

I'm not sure it's suitable for the layman, nor indeed whether there is an account of AKS that is suitable for the layman, but the book Primality Testing in Polynomial Time by Dietzfelbinger is very nice.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.