5

Euler's Theorem $$a^{\phi(n)}\equiv 1\pmod n,$$ which is valid only iff $a$ and $n$ are coprime, can be "generalized" a bit to $$a^{\phi(n)+1}\equiv a\pmod n, \tag{*}$$ where some zero-divisors of $n$ are also admissible for $a$, e.g. $$2^4\equiv 2\pmod{10},$$ while what I would like to call zero-roots$\dagger$ of $n$ fail: $$6^4\equiv 0\pmod{12}$$

But apart from these, does the generalization $(*)$ hold for all non-zero-roots of $n$?


$\dagger$ $a$ is a zero-root of $n$ $\Leftrightarrow$ $\exists k:a^k\equiv0\pmod n$ - this is the case iff all prime factors of $a$ and $n$ are the same

3 Answers3

2

The congruence

$$a^{\varphi(n)+1} \equiv a \pmod{n},$$

or, for that matter,

$$a^{\lambda(n)+1} \equiv a \pmod{n},$$

holds if and only if for all primes $p$ dividing $n$ we have $p \nmid a$ or $v_p(a) \geqslant v_p(n)$ (where $v_p(k)$ is the multiplicity of $p$ in the prime factorisation of $k$, so $p^{v_p(k)} \mid k$, but $p^{v_p(k)+1} \nmid k$).

To see that, consider a prime $p$ dividing $n$, and let $k = v_p(n)$. Then $\varphi(p^k) = (p-1)p^{k-1}$ divides $\lambda(n)$ and a fortiori $\varphi(n)$. Now let $a$ arbitrary. If $p \nmid a$, then $a^{\lambda(n)} \equiv a^{\varphi(n)} \equiv 1 \pmod{p^k}$, and $a^{\lambda(n)+1} \equiv a^{\varphi(n)+1} \equiv a \pmod{p^k}$. And if $p\mid a$, then

$$v_p(a^{\lambda(n)}) \stackrel{\varphi(p^k)\mid\lambda(n)}\geqslant v_p(a^{\varphi(p^k)}) \stackrel{p\mid a}\geqslant \varphi(p^k) = p^{k-1}(p-1) \geqslant p^{k-1} \geqslant k,$$

so $a^{\lambda(n)} \equiv 0 \pmod{p^k}$, and a fortiori $a^{\lambda(n)+1} \equiv 0 \pmod{p^k}$ and $a^{\varphi(n)+1}\equiv 0 \pmod{p^k}$. So if $p \mid a$, we have $a^{\lambda(n)+1} \equiv a \pmod{p^k} \iff a \equiv 0 \pmod{p^k}$ (and ditto for $\varphi(n)$).

Since $a^e \equiv a \pmod{n}$ if and only if $a^e \equiv a \pmod{p^{v_p(n)}}$ for all primes dividing $n$ (that last condition is not necessary, if $p \nmid n$, we have $a^e \equiv a \pmod{p^0}$ regardless), the result follows.

Daniel Fischer
  • 206,697
1

It holds at least for squarefree $n$ (which explains your mod 12 exception). This is already valid for the Carmichael function $\lambda(n)$, see http://en.wikipedia.org/wiki/Carmichael_function#Exponential_cycle_length

gammatester
  • 18,827
  • That it works for all $a$ if $n$ is squarefree was clear to me (though it's interesting that $\lambda(n)$ can be smaller than $\phi(n)$), my question is for what $a$ is this still valid if $n$ is not squarefree? – Tobias Kienzler Oct 08 '13 at 12:44
1

Another way:

$$\begin{align} a^{\phi(n)+1} &\equiv a \pmod n \quad(*) \\\Leftrightarrow a^{\phi(n)} &\equiv 1 \pmod{n/\gcd(n,a)} \end{align}$$

If $a$ and $n$ are coprime (i.e. $\gcd(n,a)=1$), this is simply Euler's Theorem and therefore true. Otherwise, since $$ \phi(a\cdot b) = \phi(a)\phi(b)\frac{\gcd(a,b)}{\phi(\gcd(a,b))},$$

let $g:=\gcd(n,a)$ and $m:=n/g$ to obtain

$$\begin{align} \phi(n) &= \phi(m\cdot g) \\ &= \phi(m)\cdot\underbrace{\frac{\phi(g)\gcd(m,g)}{\phi(\gcd(m,g))}}_{=:k} \end{align}$$

and therefore $$(*)\Leftrightarrow \left(a^k\right)^{\phi(m)} \equiv 1\pmod m$$ which is again Euler's theorem that holds iff $a^k$ and $m$ are coprime where $k=\phi(n)/\phi(m)$ and $m=n/\gcd(n,a)$.

I'll try to correlate this to Daniel Fischer's requirements later on...

  • That can't be right, for $a=6$ and $n=20$ one obtains $m=10$, $k=2$, $6^2=36$ which is not coprime to 10... – Tobias Kienzler Oct 10 '13 at 09:13
  • 1
    $(a^k)^{\phi(m)} \equiv 1 \pmod{m}$ says $\gcd(a,m) = 1$, and that says $v_p(\gcd(a,n)) = v_p(n)$ for all $p\mid a$. Same condition differently phrased. The $a=6,,n=20$ case is correct, we have $gcd(6,10) > 1$, so we don't have $6^{\phi(20)}\equiv 1 \pmod{20/2}$, and we don't have $6^{\phi(20)+1} \equiv 6 \pmod{20}$. Everything as it should be. – Daniel Fischer Oct 10 '13 at 09:17
  • Oh right, that was supposed to fail, silly me not remembering my own example... Thanks for your help, @DanielFischer! – Tobias Kienzler Oct 10 '13 at 09:25