Wilson's Theorem

Proofs
Suppose first that $p$ is composite. Then $p$ has a factor $d > 1$ that is less than or equal to $p-1$. Then $d$ divides $(p-1)!$, so $d$ does not divide $(p-1)! + 1$. Therefore $p$ does not divide $(p-1)! + 1$.

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 $p$ is a prime. Then each of the integers $1, \dotsc, p-1$ has an inverse modulo $p$. (Indeed, if one such integer $a$ does not have an inverse, then for some distinct $b$ and $c$ modulo $p$, $ab \equiv ac \pmod{p}$, so that $a(b-c)$ is a multiple of $p$, when $p$ does not divide $a$ or $b-c$—a contradiction.) This inverse is unique, and each number is the inverse of its inverse. If one integer $a$ is its own inverse, then \[0 \equiv a^2 - 1 \equiv (a-1)(a+1) \pmod{p} ,\] so that $a \equiv 1$ or $a \equiv p-1$. Thus we can partition the set $\{ 2 ,\dotsc, p-2\}$ into pairs $\{a,b\}$ such that $ab \equiv 1 \pmod{p}$. It follows that $(p-1)$ is the product of these pairs times $1 \cdot (-1)$. Since the product of each pair is conguent to 1 modulo $p$, we have \[(p-1)! \equiv 1\cdot 1 \cdot (-1) \equiv -1 \pmod{p},\] as desired. $\blacksquare$

Algebraic proof
Let $p$ be a prime. Consider the field of integers modulo $p$. By Fermat‘s Little Theorem, every nonzero element of this field is a root of the polynomial \[P(x) = x^{p-1} - 1 .\] Since this field has only $p-1$ nonzero elements, it follows that \[x^{p-1} - 1 = \prod_{r=1}^{p-1}(x-r) .\] Now, either $p=2$, in which case $a \equiv -a \pmod 2$ for any integer $a$, or $p-1$ is even. In either case, $(-1)^{p-1} \equiv 1 \pmod{p}$, so that \[x^{p-1} - 1 = \prod_{r=1}^{p-1}(x-r) = \prod_{r=1}^{p-1}(-x + r) .\] If we set $x$ equal to 0, the theorem follows. $\blacksquare$

Problems
Introductory
(Source: ARML 2002) Let $a$ be an integer such that $\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{23}=\frac{a}{23!}$. Find the remainder when $a$ is divided by $13$.
Solution
Multiplying both sides by $23!$ yields \[\frac{23!}{1}+\frac{23!}{2}+...+\frac{23!}{23}=a\] Note that $13\mid\frac{23!}{k}$ for all $k\neq13$. Thus we are left with \[a\equiv\frac{23!}{13}\equiv12!\cdot14\cdot15\cdot16\cdot...\cdot23\equiv(-1)(1)(2)(3)(...)(10)\equiv\boxed{7}\mod13\]
Advanced
If ${p}$ is a prime greater than 2, define $p=2q+1$. Prove that $(q!)^2 + (-1)^q$ is divisible by ${p}$. Solution.
Let ${p}$ be a prime number such that dividing ${p}$ by 4 leaves the remainder 1. Show that there is an integer ${n}$ such that $n^2 + 1$ is divisible by ${p}$.

Problem
For how many integers $n$ between $1$ and $50$, inclusive, is \[\frac{(n^2-1)!}{(n!)^n}\] an integer? (Recall that $0! = 1$.)

$\textbf{(A) } 31 \qquad \textbf{(B) } 32 \qquad \textbf{(C) } 33 \qquad \textbf{(D) } 34 \qquad \textbf{(E) } 35$

Solution 1
The main insight is that

\[\frac{(n^2)!}{(n!)^{n+1}}\]
is always an integer. This is true because it is precisely the number of ways to split up $n^2$ objects into $n$ unordered groups of size $n$. Thus,

\[\frac{(n^2-1)!}{(n!)^n}=\frac{(n^2)!}{(n!)^{n+1}}\cdot\frac{n!}{n^2}\]
is an integer if $n^2 \mid n!$, or in other words, if $n \mid (n-1)!$. This condition is false precisely when $n=4$ or $n$ is prime, by Wilson‘s Theorem. There are $15$ primes between $1$ and $50$, inclusive, so there are 15 + 1 = 16 terms for which

\[\frac{(n^2-1)!}{(n!)^{n}}\]
is potentially not an integer. It can be easily verified that the above expression is not an integer for $n=4$ 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 $n=p$, 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 $50-16=\boxed{\mathbf{(D)}\ 34}$.

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 $v_p (n)$ and is defined as the greatest power of some prime ‘p‘ that divides n. For example, $v_2 (6)=1$ or $v_7 (245)=2$ .) Using Legendre‘s formula, we know that :

\[v_p (n!)= \sum_{i=1}^\infty \lfloor \frac {n}{p^i} \rfloor\]
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 , $v_p (m^n) = n \cdot v_p (m)$ . Knowing that $a\mid b$ if $v_p (a) \le v_p (b)$ , we have that :

\[n \cdot v_p (n!) \le v_p ((n^2 -1 )!)\] and we must find all n for which this is true.

If we plug in $n=p$, by Legendre‘s we get two equations:

\[v_p ((n^2 -1)!) = \sum_{i=1}^\infty \lfloor \frac {n^2 -1}{p^i} \rfloor = (p-1)+0+...+0 = p-1\]
And we also get :

\[v_p ((n!)^n) = n \cdot v_p (n!)= n \cdot \sum_{i=1}^\infty \lfloor \frac {n}{p^i} \rfloor = p \cdot ( 1+0+...0) = p\]
But we are asked to prove that $n \cdot v_p (n!) \le v_p ((n^2 -1 )!) \Longrightarrow p \le p-1$ which is false for all ‘n‘ where n is prime.

Now we try the same for $n=p^2$ , where p is a prime. By Legendre we arrive at:

\[v_p ((p^4 -1)!) = p^3 + p^2 + p -3\] and \[p^2 \cdot v_p (p^2 !) = p^3 + p^2\]
Then we get:

\[p^2 \cdot v_p (p!) \le v_p ((n^4 -1)!) \Longrightarrow p^3 + p^2 \le p^3 + p^2 + p -3\] Which is true for all primes except for 2, so $2^2 = 4$ doesn‘t work. It can easily be verified that for all $n=p^i$ where $i$ is an integer greater than 2, satisfies the inequality :\[n \cdot v_p (n!) \le v_p ((n^2 -1 )!)\].

Therefore, there are 16 values that don‘t work and $50-16 = \boxed{\mathbf{(D)}\ 34}$ values that work.

Wilson's Theorem

原文地址:https://www.cnblogs.com/Eufisky/p/12194493.html

时间: 2024-08-03 02:53:43

Wilson's Theorem的相关文章

A Collection of Beautiful Theorem Proofs

There is a popular topic discussed in Quora about the most beautiful theorem proof, which I found most interesting. Now I list the ten classical thereom proofs that I fancy most.  May you enjoy them! :-) 1. Euclid's proof of Pythagorean Theorem; 2. E

计算理论中的莱斯定理(Rice's Theorem)——证明与应用

我们给出一个在探讨不可判定性时非常有用的结论--莱斯定理(Rice's Theorem).首先,我们来看前面讨论过的几个不可判定的例子: 这些都是由图灵机识别之语言的性质.而莱斯定理告诉我们,任何由图灵机识别之语言的非平凡性质(nontrivial property)都是不可判定的. 最后通过几个例子来探讨一下莱斯定理的应用.来看看下面这个语言能否使用莱斯定理来确定其可判定性. {<M> | M是一个TM,且L(M)可由一些拥有偶数个状态的图灵机识别} 首先来确定这是否是一个语言属性,显然是的

UVA 11178 Morley&#39;s Theorem 计算几何

计算几何: 最基本的计算几何,差积  旋转 Morley's Theorem Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description Problem D Morley's Theorem Input: Standard Input Output: Standard Output Morley's theorem states that that the line

[转]A plain english introduction to cap theorem

Kaushik Sathupadi Programmer. Creator. Co-Founder. Dad. See all my projects and blogs → A plain english introduction to CAP Theorem You’ll often hear about the CAP theorem which specifies some kind of an upper limit when designing distributed systems

poj 3006 Dirichlet&#39;s Theorem on Arithmetic Progressions

Description If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, ..., contains infinitely many prime numbers. This fact is known as Dirichlet's Theore

(素数求解)I - Dirichlet&#39;s Theorem on Arithmetic Progressions(1.5.5)

Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Description If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a 

master theorem

The master theorem concerns recurrence relations of the form: {\displaystyle T(n)=a\;T\!\left({\frac {n}{b}}\right)+f(n)} where {\displaystyle a\in \mathbb {N} {\mbox{, }}1<b\in \mathbb {R} } In the application to the analysis of a recursive algorith

HDU 3689 Infinite monkey theorem [KMP DP]

Infinite monkey theorem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1702 Accepted Submission(s): 882 Problem Description Could you imaging a monkey writing computer programs? Surely monkeys are

闭区间套定理(Nested intervals theorem)讲解1

① ②这里用到了极限与不等关系 ③如果a≠b,那么便不会有$\lim _{n\rightarrow \infty }\left| I_n \right| =0$ ④如果还存在一点c在 内,那么同样也不会有$\lim _{n\rightarrow \infty }\left| I_n \right| =0$ 希望深入了解闭区间套定理(Nested intervals theorem),请看讲解2:http://www.cnblogs.com/iMath/p/6260953.html