0

I am very confused by this statement "There exists some composite numbers with the property that for every $1<a < n,$ $$a^{n-1} \equiv 1 \pmod n.$$ Such numbers are called Carmichael numbers." First few examples of Carmichael numbers are $561,1105,1729\cdots.$ But I found that when $n=561 $there is $a=399$,when $n=1105$ there is $a=312$ and when $n=1729$ there is $a=462$ such that above property fails. Please explain this to me I am new to number theory.

Mark
  • 669
CJ Koirala
  • 31
  • 6

2 Answers2

4

The correct definition is that a composite number $n$ is Carmichael if $a^{n-1}\equiv 1\pmod{n}$ whenever $a$ is relatively prime to $n$, not for all $1<a<n$.

If $a^{n-1}\equiv 1\pmod{n}$ for all $1<a<n$, that actually implies that $n$ is prime, since $a^{n-1}\equiv 1\pmod{n}$ implies $a$ is relatively prime to $n$ so no such $a$ is a factor of $n$.

Eric Wofsey
  • 342,377
  • My question is does this algorithm ,If n is a prime number, then for every a, 1 <= a < n, a^(n-1) ≡ 1 (mod n) test done for all vales of a, will not fail to identify Carmichael number as composite number. – CJ Koirala Jan 13 '18 at 19:39
2

For verifying $n=561$ see here:

Verifying Carmichael numbers

For the definition, note that $n=561$ and $a=399$ are not relatively prime. Also $1105$ and $312$ are not relatively prime, and so on. But you need that $n$ and $a$ are coprime!

Dietrich Burde
  • 140,055
  • This means if I use this algorithm,If n is a prime number, then for every a, 1 <= a < n,

    a^(n-1) ≡ 1 (mod n) for primality test than this algorithm will not fail for Carmichael numbers. As Carmichael are composite number and gcd of such number with a, such that 1<=a<n will be greater than one for at least one number a,thus failing to pass the test for primality.

    – CJ Koirala Jan 13 '18 at 19:21