1
$\begingroup$

Aks algorithm has a lemma as follows

$$\text{n is prime} \iff (x+a)^n \equiv x^n + a \mod n$$

where $a \in \mathbb{Z} \land (a,n)=1, n\in \mathbb{N}-\{1\}$ and $x$ is an independent variable

For completeness I am presenting the proof of the above lemma, which has the following two parts

$$\text{n is prime} \implies (x+a)^n \equiv x^n + a \mod n$$

If $n$ is prime then $\binom{n}{r} \equiv 0 \mod n $ for $1 \le r \le n-1$

Hence first part is true

$$ (x+a)^n \equiv x^n + a \mod n \implies \text{n is prime}$$

Suppose if $n$ is composite and $k$ is the largest natural number such that $q^k | n$ for a prime factor $q|n$, then $q^k \not| \binom{n}{q}$ and hence $ \binom{n}{q}a^{n-q} \not\equiv 0 \mod n$

Here is my doubt

If we restrict the independent variable $x$ to the natural domain, the first part holds i.e,.

$$\text{n is prime} \implies (x+a)^n \equiv x^n + a \mod n$$

What about the second part?

$$ (x+a)^n \equiv x^n + a \mod n \implies \text{n is prime}$$

Does it holds true if $(x,n)=1$?

let $(x,n)=1$, then $\binom{n}{q} x^q a^{n-q} \not \equiv 0 \mod n$, but can we say that second part holds even for all $x$, such that $(x,n)=1$

To put it in short

For what values of $x \in \mathbb{N},$ the second part of the lemma satisfies

$$$$

1 Answers 1

0

Note that the lemma is about polynomials and not about number. The argument for the second part is based on the fact that if $n$ is composite then the polynomial $p(X) = (X+a)^n - (X^n+a)$ when its coefficients are reduced $\mod(n)$ is not identically zero. This is not equivalent to saying that all the possible values of $p(x)$ are non zero, but that at least for one value of $x$ we have that $p(x)$ is non zero. As an example take $n = 12$. Then $\mod 12$ we have $$ p(x) = (x+a)^{12} - (x^{12} + a) = \\ 6x^{10}a^2+4x^9a^3+3x^8a^4+3x^4a^8+4x^3a^9+6x^2a^{10}+a^{12}+11a $$ Which is clearly not identically zero. On the other hand if you do the same excercise with $n = 13$ you will obtain the zero polynomial (all the coefficients are zero).