# Carmichael Number

I am little bit confused with the definition of Carmichael Number

Wikipedia(http://en.wikipedia.org/wiki/Carmichael_number) saying that

Carmichael Number is a composite number satisfies

$b^{n}\equiv b \mod {n}$

for all integers $1<b<n$

Wolfram Mathworld(http://mathworld.wolfram.com/CarmichaelNumber.html) says that

Carmichael Number is a composite number satisfies

$a^{n-1}\equiv 1\mod {n}$

for all integers $1<a<n$

Which one of the above is correct ?

Doubt arosed because if $b^{n}\equiv b \mod {n}$ and if $b$ is not divisible by $n$ then its not necessary that $b^{n-1}\equiv b\mod {n}$

example : $3^{561} \equiv3\mod{561}$ but $3^{560}\not \equiv 1 mod{561}$

$$a^{n-1} \equiv 1 \pmod n$$
for every choice of $a$ satisfying $(a,n) = 1$ with $1 < a < n$"