Wilson's Theorem
Proofs
Suppose first that is composite. Then has a factor that is less than or equal to . Then divides , so does not divide . Therefore does not divide .
Two proofs of the converse are provided: an elementary one that rests close to basic principles of modular arithmetic, and an elegant method that relies on more powerful algebraic tools.
Elementary proof
Suppose is a prime. Then each of the integers has an inverse modulo . (Indeed, if one such integer does not have an inverse, then for some distinct and modulo , , so that is a multiple of , when does not divide or —a contradiction.) This inverse is unique, and each number is the inverse of its inverse. If one integer is its own inverse, then so that or . Thus we can partition the set into pairs such that . It follows that is the product of these pairs times . Since the product of each pair is conguent to 1 modulo , we have as desired.
Algebraic proof
Let be a prime. Consider the field of integers modulo . By Fermat's Little Theorem, every nonzero element of this field is a root of the polynomial Since this field has only nonzero elements, it follows that Now, either , in which case for any integer , or is even. In either case, , so that If we set equal to 0, the theorem follows.
Problems
Introductory
(Source: ARML 2002) Let be an integer such that . Find the remainder when is divided by .
Solution
Multiplying both sides by yields Note that for all . Thus we are left with
Advanced
If is a prime greater than 2, define . Prove that is divisible by . Solution.
Let be a prime number such that dividing by 4 leaves the remainder 1. Show that there is an integer such that is divisible by .
Problem
For how many integers between and , inclusive, is an integer? (Recall that .)
Solution 1
The main insight is that
is always an integer. This is true because it is precisely the number of ways to split up objects into unordered groups of size . Thus,
is an integer if , or in other words, if . This condition is false precisely when or is prime, by Wilson's Theorem. There are primes between and , inclusive, so there are 15 + 1 = 16 terms for which
is potentially not an integer. It can be easily verified that the above expression is not an integer for as there are more factors of 2 in the denominator than the numerator. Similarly, it can be verified that the above expression is not an integer for any prime , as there are more factors of p in the denominator than the numerator. Thus all 16 values of n make the expression not an integer and the answer is .
Solution 2
We can use the P-Adic Valuation of n to solve this problem (recall the P-Adic Valuation of 'n' is denoted by and is defined as the greatest power of some prime 'p' that divides n. For example, or .) Using Legendre's formula, we know that :
Seeing factorials involved in the problem, this prompts us to use Legendre's formula where n is a power of a prime.
We also know that , . Knowing that if , we have that :
and we must find all n for which this is true.
If we plug in , by Legendre's we get two equations:
And we also get :
But we are asked to prove that which is false for all 'n' where n is prime.
Now we try the same for , where p is a prime. By Legendre we arrive at:
and
Then we get:
Which is true for all primes except for 2, so doesn't work. It can easily be verified that for all where is an integer greater than 2, satisfies the inequality :.
Therefore, there are 16 values that don't work and values that work.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
2019-01-14 试题