1

For $a=2$, does $p=561$ pass the Fermat primality test?

$a^{n-1} = 1$ mod $ n$.

I'm confused about this question because $561$ isn't prime in the first place?

2 Answers2

2

You need to verify if $2^{560}\equiv 1 \pmod{561}$. I answer this hoping is your true question

$$2^{560}=((2^7)^5)^{16}= (2^{35})^{16}=(34359738368)^{16}=(61247305\cdot561+263)^{16}$$ $$(263)^{16}=((263)^8)^2=(22 890 010 290 541 014 721)^2$$ $$22 890 010 290 541 014 721=40802157380643520\cdot561+1$$ The square of $1$ being $1$ you have in fact $2^{560}\equiv 1 \pmod{561}$ as you desired to verify.

NOTE.-$561$ is a special number (like as if it were a prime satifying Fermat's little theorem) called of Carmichael (there are infinitely many). You have the same congruence for all number coprime with $561=3\cdot11\cdot17$, in particular with your $2$.

Ataulfo
  • 32,657
  • Thanks. I do not understand anything about what I have to do. I DON’T SPEAK ENGLISH. Without help by Google translator (very deficient so I try to arrange some nonsense) I could not participate in StackExchange, besides also provides me TexCommand difficulties. I'm tempted to leave this website even though I really like. When solving a problem, several have done answers because I linger over it in writing. For the trouble I make mistakes that would not make if I write in Spanish or French. – Ataulfo Nov 10 '15 at 01:23
  • This comment was for your kind mail, Mr M Sleziak. i did not understand what you said me to do. Sorry. Thank you very much. Sincerely yours. – Ataulfo Nov 10 '15 at 01:26
0

Yes, $561=3\times11\times 17$ is the first Carmichaël number. It shows that what Fermat's test allows to say is "if my number is not prime, then it won't pass the test". Nothing allows to say that your number is prime if it passes the test.

Balloon
  • 8,624