Wilson’s theorem
https://artofproblemsolving.com/wiki/
https://artofproblemsolving.com/wiki/index.php/Wilson%27s_Theorem#:~:text=Wilson%27s%20Theorem%20In%20number%20theory%2C%20Wilson%27s%20Theorem%20states,The%20French%20mathematician%20Lagrange%20proved%20it%20in%201771.
Wilson's Theorem
In number theory, Wilson's Theorem states that if integer , then
is divisible by
if and only if
is prime. It was stated by John Wilson. The French mathematician Lagrange proved it in 1771.
Contents
[hide]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
.
See also
Category: Number Theory
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理