# Thread:

1. ## Applying Fermat and Wilson's Theorem

Hi everyone! I just had a couple questions about a few things I read in a textbook.

There were a couple points made that did not show any proof. I was able to prove some of them but the two listed below gave me some trouble. I like to see why things are so and need the proof in order to accept its validity. I was wondering if anyone here could help me prove these?

--- If b > 1 is not prime, then (b-1)! is not congruent to -1 (mod b)
--- If p is an odd prime, then (p-3)! ≡ (p-1)/2 (mod p)

Thank You!

2. #1: If you know Wilson's theorem, then what is the contrapositive of its statement?

#2: By Wilson's theorem, $(p-1)! \equiv - 1 \ (\text{mod } p)$

But: $(p-1)! = (p-1)(p-2)(p-3)!$

Can you finish off?

3. Originally Posted by o_O
#1: If you know Wilson's theorem, then what is the contrapositive of its statement?
#1 is not the contrapositive of Wilson's theorem!

Suppose $p|b$, $p \neq b$. Then $p|(b-1)!$. If $(b-1)!+1\equiv 0 \mod b$ then $(b-1)!+1 = kb$ for some $k \in \mathbb{Z}$. Now $p|b, p|(b-1)!$ but $p \nmid 1$, which is impossible.

4. Hmm .. you sure? Wilson's theorem is a biconditional statement. So if we take the direction that: $(b-1)! \equiv -1 \ (\text{mod b}) \ \Rightarrow \ b \text{ is prime.}$

Then this is logically equivalent to saying if b is not prime, then etc. etc.

5. Oh, in that case you are correct! In my mind Wilson's theorem was "If $p$ is prime, then $(p-1)! \equiv -1 \mod p$", but it makes sense to include the other direction as well.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 13, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9696532487869263, "perplexity_flag": "middle"}