# Wilson theorem

• May 15th 2009, 11:34 PM
gdmath
Wilson theorem
Hi everybody,

I am looking on wilson theorem and i find this:

(p-1)! = -1 (mod p) iif p is prime.

I have nowhere find this:

(p-1)! = (p-1) (mod p) iif p is prime.

Why the first notation is used???
• May 16th 2009, 12:53 AM
Gamma
It really all depends on what you know at this point, there are a ton of proofs of this. I think the most elementary way is by noticing that $\mathbb{Z}_p$ is a field. In particular the nonzero elements form a group under multiplication. Inverses are unique, so when you look at

$(p-1)!=\prod_{x=1}^{p-1}x$ you are just left with the product of things that are their own inverse. That is the things such that $x^2=1$, this is clearly 1 and $-1 \equiv p-1$ (mod p).

Thus $(p-1)!=\prod_{x=1}^{p-1}x\equiv p-1 \equiv -1$ (mod p).

The converse is trivial because if $\mathbb{Z}_n$ when n is composite, say n=jk. Then (p-1)!=0 because j and k are zero divisors.
• May 16th 2009, 01:37 AM
gdmath
First of all thank you for your time.
Indeed if you use ring theory with desired properties (ex. inverting elements), yes you have the desired result.
However here my objection comes. Why we use not real models and properties to show the simple logic? There is not negative modulo between integers. Also there are no identical integer inverses into real world.
When i first noticed wilson theorem (use for a computer algorithm) I totaly confuded.
I had to look at other theories that have other axioms than these we sense.
Anyway thank you again.
• May 16th 2009, 01:52 AM
Gamma
I am not entirely sure I follow what you mean? There are an infinite number of negative numbers congruent to any of the least positive residues. And as far as not using modular arithmetic in the "real world", I gotta say I disagree with you. We use modular arithmetic all the time in the real world. Ever look at the clock? It is mod 12.

I am kind of interested in what computer algorithm you encountered that used Wilson's Theorem. I have seen it come up in some pretty strange places, and it amazes me when such a seemingly arbitrary relation is so useful. I recall once getting it out of the class equation or Sylow Theorem, I forget now. It came out of some Galois Theory stuff I was doing too this semester.
• May 16th 2009, 02:06 AM
gdmath
I work on prime numbers detection (for my own interest) via computer algorithm.
As soon i have something interesting i type it in this forum.

Because i need it for furter use, i am trying to aproach defferently wilson's theorem.
i focus in the following tecnique:

I try to relate the patterns (p-n)! % p together.
I noticed that (p-2) % p = 1 (this implied also from your answer)
-p is prime, % is modulo
Anyway if i have something interesting i type it.
Thanks again
• May 16th 2009, 02:14 AM
Gamma
I assume you meant $(p-2)$! $\equiv 1$ % p. But yes, that is also true, in fact I remember when I first learned Wilson's Theorem in number theory, I was surprised this was not the way it was stated as it seems much nicer to get 1 than -1.

I do not know how much background you have in number theory, but I suggest investigating Quadratic Reciprocity some, it may prove useful for you in your work. Wikipedia has a pretty lengthy article on this and lots of fascinating results with primes. Quadratic reciprocity - Wikipedia, the free encyclopedia

Take care.
• May 16th 2009, 02:19 AM
gdmath
I ll check,
Thanks
• May 16th 2009, 02:26 AM
gdmath
Also check the following:

(p-1)!/a % p != (p-1)!/b % p

a, b <p, % modulo, p prime, != inequality.

I encountered this is in factorization of Zeta fucntion!
• May 16th 2009, 02:27 AM
gdmath