**Fermat's Little Theorem**: If $p$ is a prime and $\gcd(a,p)=1$ then $a^{p-1} \equiv1\pmod p$.


Over the years, Fermat's Little Theorem have been generalized in several ways. I am aware of four different generalizations as given below.


**1. Euler**: If $\gcd(a,n)=1$ then $a^{\phi(n)} \equiv1 \pmod n$.


**2. Ramachandra**: $\sum\_{d|n}\mu(d)a^{n/d} \equiv 0\pmod n$. (*Fermat's Little Theorem follows when $n=p$ is a prime and has only two divisors 1 and $p$*. 


**3**. Let $d$ be a divisor of $\phi(n)$. There are exactly $d$ distinct positive integers $r\_k, (k=1,2, \ldots d)$ such if $\gcd(x,n)=1$ then $x^{\phi(n)/d} \equiv r\_k \pmod n$ for some $(k=1,2, \ldots d)$ (*Euler's generalization itself is a special case of this result when $d=1$*.)


**4. Florentin Smarandache**: $a^{\phi(n\_s)+s} \equiv a^s \pmod n$ where $s$ and $n\_s$ are defined in [Smarandache's paper](http://arxiv.org/ftp/math/papers/0610/0610607.pdf)


I would like to know if there is any other generalization of Fermat's Little Theorem. 



Any more generalization of Fermat's Little Theorem?
Fermat's little theorem is a consequence of the fact that the group $(\mathbf{Z}/p\mathbf{Z})^\times$ is cyclic of order $p-1$. Euler's theorem is a consequence of the fact that the (commutative) group $(\mathbf{Z}/n\mathbf{Z})^\times$ has order $\varphi(n)$. 


What happens when we replace $\mathbf{Z}$ by the ring of integers $\mathfrak{o}$ in some number field ? If we take a prime ideal $\mathfrak{p}$ of $\mathfrak{o}$, then the quotient $\mathfrak{o}/\mathfrak{p}$ is a finite field; if it has $q$ elements, then
$$
x^{q-1}\equiv 1\pmod{\mathfrak{p}}
$$
for every $x\in\mathfrak{o}$ not in $\mathfrak{p}$. There is an obvious generalisation to the case of an arbitrary ideal $\mathfrak{a}\subset\mathfrak{o}$ and $x\in\mathfrak{o}$ prime to $\mathfrak{a}$ in the sense that $x\mathfrak{o}+\mathfrak{a}=\mathfrak{o}$. 


