(Wolstenholme's Theorem) Prove that if \[1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{p-1}\] is expressed as a fraction, where $p \ge 5$ is a prime, then $p^{2}$ divides the numerator.
Problem
Source:
Tags: quadratics, Gauss, modular arithmetic, number theory, relatively prime, Divisibility Theory, pen
25.05.2007 03:24
We will treat rational numbers, which have their denominator relatively prime to $p$, as residues mod $p$. From the Fermat's Little Theorem: $\frac{1}{i} \equiv i^{p-2} \mod{p}$ So we see that: $\sum_{i=1}^{p-1} \frac{1}{i} \equiv \sum_{i=1}^{p-1} i^{p-2} = \sum_{i=1}^{\frac{p-1}{2}} i^{p-2} + (p-i)^{p-2} \equiv \sum_{i=1}^{\frac{p-1}{2}} p(p-2)i^{p-3} = p(p-2) \sum_{i=1}^{\frac{p-1}{2}} i^{p-3} \mod{p^2}$ The last congruence comes from the fact that the rest term vanishes mod $p^2$. We are left with proving that: $\sum_{i=1}^{\frac{p-1}{2}} i^{p-3} \equiv 0 \mod{p}$ or (one more time from FTL): $\sum_{i=1}^{\frac{p-1}{2}} \frac{1}{i^2} \equiv 0 \mod{p}$ Now if $i, j \leq \frac{p-1}{2}$ and $\frac{1}{i^2} \equiv \frac{1}{j^2} \mod{p}$ then also $(i-j)(i+j) \equiv 0 \mod{p}$ but since $i, j \leq \frac{p-1}{2}$ we must have $i=j$. So the numbers: $\frac{1}{i^2}$ for $i=1,2,...,\frac{p-1}{2}$ are all different quadratic residues (and there are exactly $\frac{p-1}{2}$ quadratic residues), as well as the numbers $i^2$ for $i=1,2,...,\frac{p-1}{2}$ so: $\sum_{i=1}^{\frac{p-1}{2}} \frac{1}{i^2} \equiv \sum_{i=1}^{\frac{p-1}{2}} i^2 = \frac{p(p-1)(p+1)}{24} \equiv 0 \mod{p}$ which ends the proof.
25.05.2007 03:24
I love it. This is a beautiful proof.
25.05.2007 03:24
Peter wrote: (Wolstenholme's Theorem) Prove that if \[ 1 + \frac {1}{2} + \frac {1}{3} + \cdots + \frac {1}{p - 1}\]is expressed as a fraction, where $ p \ge 5$ is a prime, then $ p^{2}$ divides the numerator. This is an updated version of an older MathLinks post of mine, and I am submitting it here since I will refer to it in a number of other proofs. I will generalize the problem, but first I explain some preliminaries about primes. 1. p-adic valuation Let $p$ be an arbitrary prime. We denote by $ \mathbb{Z}_{p}$ the field of residues of integers modulo $p$. For any rational number $x$, we will now define the so-called $p$-adic valuation of $x$. This valuation will be denoted by $ v_{p}\left(x\right)$, and it is defined as follows: If $ x\neq 0$, then $ v_{p}\left(x\right)$ is the greatest integer $k$ such that $\frac{x}{p^{k}}$ can be written as a ratio of two integers with the denominator not being divisible by $p$. Besides, we set $ v_{p}\left(0\right) = + \infty$, where $ + \infty$ is just a symbol satisfying $ + \infty > a$ and $ + \infty + a = + \infty$ for any integer $ a$. (The main thing we will need about $+ \infty$ is that $ v_{p}\left(0\right) > v_{p}\left(x\right)$ for any nonzero $x$). We can easily see how to compute $ v_{p}\left(x\right)$ for rationals $ x\neq 0$: * If $x$ is a nonzero integer, then $ v_{p}\left(x\right)$ is the greatest integer $k$ such that $ p^{k}$ divides $x$ (thus, in particular, we have $ v_{p}\left(x\right) = 0$ if $p$ doesn't divide $x$). * If $x$ is a ratio of two nonzero integers, say $ x = \frac{a}{b}$ with nonzero integers $a$ and $b$, then $ v_{p}\left(x\right) = v_{p}\left(a\right) - v_{p}\left(b\right)$. Note that there is a simple way to interpret the sign of the $p$-adic valuation $ v_{p}\left(x\right)$ of a rational number $x$: If we write $x$ as a reduced fraction (i.e., a fraction with numerator and denominator coprime; if $x$ is an integer, then just write it in the form $x = \frac{x}{1}$), and it turns out that the numerator is divisible by $p$, then $ v_{p}\left(x\right) > 0$; if neither the numerator nor the denominator is divisible by $p$, then $ v_{p}\left(x\right) = 0$; if the denominator is divisible by $p$, then $ v_{p}\left(x\right) < 0$. A $p$-integer shall mean a rational number $x$ satisfying $v_p\left(x\right) \geq 0$. In particular, every integer is a $p$-integer. Moreover, any fraction of integers is a $p$-integer if its denominator is coprime to $p$. It is rather easy to prove that for any two rational numbers $x$ and $y$, we have $ v_{p}\left(xy\right) = v_{p}\left(x\right) + v_{p}\left(y\right)$ and $v_{p}\left(x + y\right)\geq\min\left(v_{p}\left(x\right);\;v_{p}\left(y\right)\right)$. Thus, the sum and the product of two $p$-integers are $p$-integers again. Hence, it is not hard to see that any sum or product of finitely many $p$-integers is a $p$-integer, and that a difference of two $p$-integers is always a $p$-integer. (In the language of abstract algebra, this is saying that the $p$-integers form a subring of $\mathbb{Q}$.) 2. Working with fractions modulo $p$ I will use the notation $\mathbb{Z}_{p}$ for the ring $\mathbb{Z} / p\mathbb{Z}$ (that is, the ring of integers modulo $p$). We will also need some familiarity with fractions in $\mathbb{Z}_{p}$. The main idea is to extend the notion of congruence modulo $p$ from integers to $p$-integers: If $x$ and $y$ are two $p$-integers, then we say that $x\equiv y\mod p$ (in words: "$x$ is congruent to $y$ modulo $p$") if and only if $v_{p}\left(x - y\right) > 0$. Thus we have defined a relation ("congruence modulo $p$") on the set of all $p$-integers. This relation is an equivalence relation (this is easy to prove; do it!). Moreover, if $x$ and $y$ are two integers, then $x \equiv y \mod p$ with respect to this new equivalence relation if and only if $x \equiv y \mod p$ in the usual sense (i.e., we have $p \mid x-y$ in $\mathbb{Z}$). This fact allows us to use the same notation for both equivalence relations without worrying about possible ambiguity. It is easy to see that this equivalence relation has the same properties as the classical "congruence modulo $p$" relation on integers: * If $a$, $b$, $c$ and $d$ are $p$-integers, and if $a \equiv b \mod p$ and $c \equiv d \mod p$, then $a+c \equiv b+d \mod p$ and $a-c \equiv b-d \mod p$ and $ac \equiv bd \mod p$. In other words, congruences modulo $p$ between $p$-integers can be added, subtracted and multiplied just as congruences between integers. * The same holds for larger sums: i.e., if $a_1, a_2, \ldots, a_j, b_1, b_2, \ldots, b_j$ are $p$-integers, and if every $i$ satisfies $a_i \equiv b_i \mod p$, then $\sum\limits_{i=1}^j a_i \equiv \sum\limits_{i=1}^j b_i \mod p$. * If $a$, $b$, $c$ and $d$ are $p$-integers such that $v_p\left(b\right) = 0$ and $v_p\left(d\right) = 0$, and if $a \equiv b \mod p$ and $c \equiv d \mod p$, then $a/c \equiv b/d \mod p$. In other words, congruences modulo $p$ between $p$-integers can be divided by one another, as long as the $p$-integers we are dividing by have $p$-adic valuations equal to $0$. We shall refer to this fact as the division rule. Recall that congruence modulo $p$ is an equivalence relation on the set of $p$-integers. Let $F_p$ denote the set of equivalence classes of this equivalence relation. One might expect that $F_p$ is larger than $\mathbb{Z}_p$, seeing that the equivalence classes that comprise $F_p$ consist of $p$-integers whereas the equivalence classes that comprise $\mathbb{Z}_p$ consist of integers only. But in fact, it turns out that $F_p$ is in bijection with $\mathbb{Z}_p$. Indeed, it is easy to prove that for every $p$-integer $x$, there is one and only one integer $n$ satisfying $0\leq n < p$ such that $x\equiv n\mod p$. Thus, every equivalence class in $F_p$ contains exactly one of the integers $0, 1, \ldots, p-1$, and thus corresponds to a unique equivalence class in $\mathbb{Z}_p$. Equivalence classes in $F_p$ can be added, subtracted and multiplied (just as in $\mathbb{Z}_p$), and these operations match precisely the analogous operations in $\mathbb{Z}_p$ (that is, if you add two equivalence classes in $F_p$, then the corresponding class in $\mathbb{Z}_p$ is obtained by adding the classes in $\mathbb{Z}_p$ that correspond to the two addends; and similarly for subtraction and multiplication). Furthermore, if $x$ and $y$ are two equivalence classes in $F_p$, then $x/y$ is a well-defined equivalence class in $F_p$ provided that $y$ is the equivalene class of a $p$-integer $u$ with $v_p\left(u\right) = 0$. (Again, it is constructed as usual: Pick an element $a \in x$ and an element $b \in y$, and form the equivalence class of the rational number $a/b$.) Hence, you can work with $p$-integers modulo $p$ in the same way as you work with integers modulo $p$. This also means that modulo $p$, you can uniquely divide by any integer not divisible by $p$. [A nice application of this is problem 4 of the IMO 2005 - see Fedor Petrov's proof in post #2.] 3. Generalization of Wolstenholme's Theorem Now, the problem A 23 asks us to show that if $ p$ is a prime number such that $ p\geq 5$, then $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k}\right)\geq 2$. This is a particular case (namely, the $ u = 1$ case) of the following result: Theorem 1. Let $ p$ be a prime number, and $ u$ be an odd integer such that $ p\geq u + 3$ and $ u\geq 0$. Then, $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right)\geq 2$. Proof of Theorem 1. We have $ p > 2$ (since $ p\geq u + 3$ and $ u\geq 0$). We start with the Gauss trick: $ 2\sum_{k = 1}^{p - 1}\frac {1}{k^{u}} = \sum_{k = 1}^{p - 1}\frac {1}{k^{u}} + \sum_{k = 1}^{p - 1}\frac {1}{k^{u}} = \sum_{k = 1}^{p - 1}\frac {1}{k^{u}} + \sum_{k = 1}^{p - 1}\frac {1}{\left(p - k\right)^{u}}$ $= \sum_{k = 1}^{p - 1}\left(\frac {1}{k^{u}} + \frac {1}{\left(p - k\right)^{u}}\right) = \sum_{k = 1}^{p - 1}\frac {k^{u} + \left(p - k\right)^{u}}{k^{u}\left(p - k\right)^{u}}$. Now, define $ s_k=\sum_{i=2}^u\left(-1\right)^{u-i}\binom{u}{i}p^{i-2}k^{u-i}$ for every $ k\in\left\{1,2,...,p-1\right\}$. Obviously, $ s_k$ is an integer for every $ k$. We can expand $ \left(p - k\right)^{u}$ according to the binomial formula: $ \left(p - k\right)^{u}=\sum_{i=0}^u\left(-1\right)^{u-i}\binom{u}{i}p^ik^{u-i}$ $ =\left(-1\right)^{u-0}\binom{u}{0}p^0k^{u-0}+\left(-1\right)^{u-1}\binom{u}{1}p^1k^{u-1}+\sum_{i=2}^u\left(-1\right)^{u-i}\binom{u}{i}p^ik^{u-i}$ $ =\left(-1\right)^uk^u+\left(-1\right)^{u-1}upk^{u-1}+p^2\sum_{i=2}^u\left(-1\right)^{u-i}\binom{u}{i}p^{i-2}k^{u-i}$ $ =\left(-1\right)^uk^u+\left(-1\right)^{u-1}upk^{u-1}+p^2s_k$ $=\left(-1\right)k^u+1upk^{u-1}+p^2s_k$ (since $u$ is odd, so that $ \left(-1\right)^u=-1$ and $ \left(-1\right)^{u-1}=1$) $ =-k^u+upk^{u-1}+p^2s_k$. Thus, $ k^u+\left(p-k\right)^u = upk^{u-1}+p^2s_k$ for every $ k\in\left\{1,2,...,p-1\right\}$, and therefore $ 2\sum_{k = 1}^{p - 1}\frac {1}{k^{u}} = \sum_{k = 1}^{p - 1}\frac {k^{u} + \left(p - k\right)^{u}}{k^{u}\left(p - k\right)^{u}} = \sum_{k = 1}^{p - 1}\frac {upk^{u-1}+p^2s_k}{k^{u}\left(p - k\right)^{u}} = \sum_{k = 1}^{p - 1} p \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}$ $ = p \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}$. Hence, $ v_{p}\left(2\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right) = v_{p}\left( p \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right) = \underbrace{v_{p}\left(p\right)}_{=1} + v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right)$ $ = 1 + v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right)$. But since $ 2$ isn't divisible by $ p$ (since $ p > 2$), we have $ v_{p}\left(2\right) = 0$, so that $ v_{p}\left(2\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right) = \underbrace{v_{p}\left(2\right)}_{=0} + v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right) = v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right)$. Comparing these two equalities, we get $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right) = 1 + v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right)$. Hence, instead of showing $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right)\geq 2$, it will be enough to prove $ v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right)\geq 1$. This is equivalent to $ v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right) > 0$, i.e., to $ \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \equiv 0\mod p$. Here, we are using the fact that for every $ k\in\left\{1,2,...,p-1\right\}$, the fraction $ \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}$ is a $p$-integer (because its denominator, $ k^{u}\left(p - k\right)^{u}$, is not divisible by $ p$, since $ 1\leq k\leq p - 1$ and since $ p$ is a prime), and therefore it makes sense to say that the sum of all these fractions is $\equiv 0 \mod p$. Let us now look more closely at such a fraction $\frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}$ (with $k \in \left\{1,2,\ldots,p-1\right\}$). The numerator $ uk^{u-1}+ps_k$ of this fraction is congruent to $ uk^{u - 1}$ modulo $p$ (since $ p\equiv 0\mod p$, and thus all terms containing $ p$ can be omitted). Also, the denominator can be simplified modulo $p$: Since $ p - k\equiv - k\mod p$, we have $ k^{u}\left(p - k\right)^{u}\equiv k^{u}\left( - k\right)^{u} = \left( - 1\right)^{u}k^{2u} \mod p$. Dividing the congruence $uk^{u-1}+ps_k \equiv uk^{u-1} \mod p$ by the latter congruence, we obtain $ \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \equiv \frac {uk^{u-1}}{\left(-1\right)^u k^{2u}}\mod p$ (here, we have applied the division rule, since the rational numbers $k^{u}\left(p - k\right)^{u}$ and $\left(-1\right)^u k^{2u}$ have $p$-adic valuation $0$). Therefore, (1) $ \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}\equiv\sum_{k = 1}^{p - 1}\frac {uk^{u - 1}}{\left( - 1\right)^{u}k^{2u}} = \sum_{k = 1}^{p - 1}\frac {uk^{-u - 1}}{\left( - 1\right)^{u}} = \frac {u}{\left( - 1\right)^{u}}\sum_{k = 1}^{p - 1}k^{ - u - 1}\mod p$. But by Fermat's Little Theorem, $ k^{p - 1}\equiv 1\mod p$ for every integer $ k$ such that $ 1\leq k\leq p - 1$. Thus, every such $k$ satisfies $ k^{ - u - 1}\equiv k^{ - u - 1}k^{p - 1} = k^{p - u - 2}\mod p$, and the relation (1) becomes $ \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}\equiv\frac {u}{\left( - 1\right)^{u}}\sum_{k = 1}^{p - 1}k^{p - u - 2}\mod p$. Now, $ p - u - 2\geq 1$ (since $ p\geq u + 3$) and $ p - u - 2\leq p - 2$. Also, $ p$ is an odd prime (since $ p$ is a prime and $ p > 2$). Now, according to http://www.problem-solving.be/pen/viewtopic.php?t=676 part a) (and also http://www.mathlinks.ro/Forum/viewtopic.php?t=40171 ), we have: Theorem 2. If $ p$ is an odd prime and $ \rho$ is an integer such that $ 1\leq\rho\leq p - 2$, then $ p\mid\sum_{k = 1}^{p - 1}k^{\rho}$. Applying this Theorem 2 to our prime $ p$ and $ \rho = p - u - 2$ (we know that $ p$ is an odd prime and $ \rho = p - u - 2$ satisfies $ 1\leq p - u - 2\leq p - 2$), we get $ p\mid\sum_{k = 1}^{p - 1}k^{p - u - 2}$, so that $ \sum_{k = 1}^{p - 1}k^{p - u - 2}\equiv 0\mod p$, and thus $ \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}}\equiv\frac {u}{\left( - 1\right)^{u}} \underbrace{\sum_{k = 1}^{p - 1}k^{p - u - 2}}_{\equiv 0\mod p} \equiv \frac {u}{\left( - 1\right)^{u}}\cdot 0 = 0\mod p$. This completes the proof of Theorem 1. 4. A divisibility by $ p^3$ We can use almost the same tactics to prove a similar result: Theorem 3. Let $ p$ be a prime number such that $ p>3$. Then, $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^p}\right)\geq 3$. Proof of Theorem 3. It is known that for every integer $ i$ such that $ 0<i<p$, we have $ p\mid \binom{p}{i}$ (since $ p$ is prime); in other words, $ \binom{p}{i}\equiv 0\mod p$. Besides, $ p-2>0$ (since $ p>3>2$). Set $ u=p$. Also, denote $ s_k=\sum_{i=2}^u\left(-1\right)^{u-i}\binom{u}{i}p^{i-2}k^{u-i}$ for every $ k\in\left\{1,2,...,p-1\right\}$. Obviously, $ s_k$ is an integer for every $ k$. Then, every $ k\in\left\{1,2,...,p-1\right\}$ satisfies $ s_k=\sum_{i=2}^u\left(-1\right)^{u-i}\binom{u}{i}p^{i-2}k^{u-i}=\sum_{i=2}^p\left(-1\right)^{p-i}\binom{p}{i}p^{i-2}k^{p-i}$ (since $ u=p$) $ =\sum_{i=2}^{p-1}\left(-1\right)^{p-i}\underbrace{\binom{p}{i}}_{\substack{\equiv 0\mod p,\\ \text{ since } 0<i<p}}p^{i-2}k^{p-i}+\left(-1\right)^{p-p}\binom{p}{p}\underbrace{p^{p-2}}_{\substack{\equiv 0\mod p,\\ \text{ since } p-2>0}}k^{p-p}$ $ \equiv \underbrace{\sum_{i=2}^{p-1}\left(-1\right)^{p-i}0p^{i-2}k^{p-i}}_{=0}+\underbrace{\left(-1\right)^{p-p}\binom{p}{p}0k^{p-p}}_{=0}=0+0=0\mod p$. Just as in the proof of Theorem 1, we can show that (2) $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right) = 1 + v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right)$. Since $ u=p$, we have $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{u}}\right) = v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^p}\right)$ and $ v_{p}\left( \sum_{k = 1}^{p - 1} \frac {uk^{u-1}+ps_k}{k^{u}\left(p - k\right)^{u}} \right) = v_{p}\left( \sum_{k = 1}^{p - 1} \frac {pk^{p-1}+ps_k}{k^p\left(p - k\right)^p} \right)$ $ = v_{p}\left( p\cdot \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right)$ (since $ \sum_{k = 1}^{p - 1} \frac {pk^{p-1}+ps_k}{k^p\left(p - k\right)^p} = \sum_{k = 1}^{p - 1} \frac {p\left(k^{p-1}+s_k\right)}{k^p\left(p - k\right)^p} = \sum_{k = 1}^{p - 1} p\cdot \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} = p\cdot \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p}$) $ = \underbrace{v_p\left(p\right)}_{=1} + v_p\left( \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right) = 1 + v_p\left( \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right)$. Thus, (2) becomes $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^p}\right) = 1 + \left(1 + v_p\left( \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right)\right)$. In other words, $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^p}\right) = 2 + v_p\left( \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right)$. Hence, instead of showing $ v_{p}\left(\sum_{k = 1}^{p - 1}\frac {1}{k^{p}}\right)\geq 3$, it will be enough to prove $ v_p\left( \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right)\geq 1$. This is equivalent to $ v_p\left( \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \right) > 0$, i.e., to $ \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \equiv 0\mod p$. Here, we are using the fact that for each $k \in \left\{1,2,\ldots,p-1\right\}$, the fraction $\frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p}$ is a $p$-integers (because its denominator, $ k^p\left(p - k\right)^p$, is not divisible by $ p$, since $ 1\leq k\leq p - 1$ and since $ p$ is a prime), and thus it makes sense to speak of congruence modulo $p$ for the sum of these fractions. Let us study such a fraction $\frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p}$ (with $k \in \left\{1,2,\ldots,p-1\right\}$) more closely: Its numerator $ k^{p-1}+s_k$ is congruent to $ k^{p-1}$ modulo $p$ (since $ s_k\equiv 0\mod p$, and thus the term $ s_k$ can be omitted). Also, the denominator can be simplified: Since $ p - k\equiv - k\mod p$, we have $ k^p\left(p - k\right)^p\equiv k^p\left( - k\right)^p = \left( - 1\right)^pk^{2p} \mod p$. Hence, $ \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \equiv \frac {k^{p-1}}{\left( - 1\right)^pk^{2p}} \mod p$ (by the division rule). Therefore, (3) $ \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \equiv \sum_{k = 1}^{p - 1}\frac {k^{p-1}}{\left( - 1\right)^pk^{2p}} = \frac{1}{\left(-1\right)^p} \sum_{k = 1}^{p - 1}\frac {k^{p-1}}{k^{2p}} \mod p$. But by Fermat's Little Theorem, $ k^p\equiv k\mod p$ for every integer $ k$. Thus, $ \left(k^p\right)^2\equiv k^2\mod p$, so that $ k^{2p}=\left(k^p\right)^2\equiv k^2\mod p$. Hence, for every $k \in \left\{1,2,\ldots,p-1\right\}$, we have $\frac{k^{p-1}}{k^{2p}} \equiv \frac{k^{p-1}}{k^2} \mod p$ (here we used the division rule again, because $k^{2p}$ and $k^2$ are rational numbers with $p$-adic valuation $0$). Hence, the relation (3) becomes $ \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \equiv \frac{1}{\left(-1\right)^p} \sum_{k = 1}^{p - 1}\underbrace{\frac {k^{p-1}}{k^2}}_{ = k^{\left(p-1\right)-2}=k^{p-3}} = \frac{1}{\left(-1\right)^p} \sum_{k = 1}^{p - 1}k^{p-3} \mod p$. Now, $ p-3\geq 1$ (since $ p>3$ yields $ p-3>0$, and $ p-3\in\mathbb{Z}$) and $ p-3\leq p-2$. Also, $ p$ is an odd prime (since $ p$ is a prime and $ p > 2$). Applying Theorem 2 to our prime $ p$ and $ \rho = p - 3$ (we know that $ p$ is an odd prime and $ \rho = p-3$ satisfies $ 1\leq p-3\leq p - 2$), we get $ p\mid\sum_{k = 1}^{p - 1}k^{p - 3}$, so that $ \sum_{k = 1}^{p - 1}k^{p - 3}\equiv 0\mod p$, and thus $ \sum_{k = 1}^{p - 1} \frac {k^{p-1}+s_k}{k^p\left(p - k\right)^p} \equiv \frac{1}{\left(-1\right)^p} \underbrace{\sum_{k = 1}^{p - 1}k^{p-3}}_{\equiv 0\mod p} \equiv \frac{1}{\left(-1\right)^p}\cdot 0 = 0\mod p$. This completes the proof of Theorem 3. [EDIT: Made the proof of Theorem 1 slightly more formal, and added section 4. See the other thread for the old version of this post. EDIT 2: Improved the exposition of $p$-integers and their congruence significantly.] Darij
03.07.2008 19:11
TomciO wrote: $ \sum_{i = 1}^{p - 1} \frac {1}{i} \equiv \sum_{i = 1}^{p - 1} i^{p - 2}$ Why is this true mod $ p^2$?
03.07.2008 19:40
Yes, you are right. Thank you for pointing out the mistake. I have corrected the proof accordingly since it's not a big difference. We will treat rational numbers, which have their denominator relatively prime to $ p$, as residues mod $ p$. From the Euler's Theorem: $ \frac {1}{i} \equiv i^{p(p-1) - 1} \mod{p^2}$ So we see that: \[ \sum_{i = 1}^{p - 1} \frac {1}{i} \equiv \sum_{i = 1}^{p - 1} i^{p(p-1) - 1} = \sum_{i = 1}^{\frac {p - 1}{2}} i^{p(p-1) - 1} + (p - i)^{p(p-1) - 1} \equiv \sum_{i = 1}^{\frac {p - 1}{2}} p(p(p-1) - 1)i^{p(p-1) - 2} \equiv -p \sum_{i = 1}^{\frac {p - 1}{2}} i^{p(p-1) - 2} \mod{p^2}\] The congruence come from the fact that the rest term vanishes mod $ p^2$. We are left with proving that: $ \sum_{i = 1}^{\frac {p - 1}{2}} i^{p(p-1) - 2} \equiv 0 \mod{p}$ or from FTL: $ \sum_{i = 1}^{\frac {p - 1}{2}} \frac {1}{i^2} \equiv 0 \mod{p}$ Now if $ i, j \leq \frac {p - 1}{2}$ and $ \frac {1}{i^2} \equiv \frac {1}{j^2} \mod{p}$ then also $ (i - j)(i + j) \equiv 0 \mod{p}$ but since $ i, j \leq \frac {p - 1}{2}$ we must have $ i = j$. So the numbers: $ \frac {1}{i^2}$ for $ i = 1,2,...,\frac {p - 1}{2}$ are all different quadratic residues (and there are exactly $ \frac {p - 1}{2}$ quadratic residues), as well as the numbers $ i^2$ for $ i = 1,2,...,\frac {p - 1}{2}$ so: $ \sum_{i = 1}^{\frac {p - 1}{2}} \frac {1}{i^2} \equiv \sum_{i = 1}^{\frac {p - 1}{2}} i^2 = \frac {p(p - 1)(p + 1)}{24} \equiv 0 \mod{p}$ which ends the proof.
14.08.2008 05:15
Maybe we can use fields to solve this in a more efficient way!
20.08.2011 00:13
We begin with a lemma. Lemma. Let $k \in \mathbb{Z}$. Then $1^k + 2^k + \cdots + (p - 1)^k \equiv 0 \pmod{p}$ whenever $p - 1$ does not divide $k$. Proof: This is an often used result in number theory. See my post in http://www.artofproblemsolving.com/Forum/viewtopic.php?t=422958 for a proof. Unless mentioned otherwise, all quantities should be taken as elements of $\mathbb{Z}/p^2\mathbb{Z}$. Next, observe that if $1 \leq i \leq p - 1$, we have \[(p - i)(p + i) = p^2 - i^2 = -i^2,\] which, after some rearranging, gives \[\frac1{p - i} = -\frac{p + i}{i^2}.\] Therefore, \[1 + \cdots + \frac1{p - 1} = -\left(\frac{p + 1}{1^2} + \frac{p + 2}{2^2} + \cdots + \frac{p + (p - 1)}{(p - 1)^2}\right),\] so, after splitting up the fractions on the right side and rearranging, we get \[2\left(1 + \cdots + \frac1{p - 1}\right) = -p\left(1 + \frac 1{2^2} + \cdots + \frac1{(p - 1)^2}\right).\] Since $p \neq 2$, if we can show that $p | 1 + \frac1{2^2} + \cdots + \frac1{(p - 1)^2}$, then we know that $p^2 | 1 + \frac12 + \cdots + \frac1{p - 1}$, as desired. Indeed, since $p > 3$, $p-1$ does not divide $-2$, so the lemma gives that \[1 + \frac1{2^2} + \cdots + \frac1{(p - 1)^2} = 1^{-2} + 2^{-2} + \cdots + (p - 1)^{-2} \equiv 0 \pmod{p},\] completing the proof.
11.03.2013 19:23
is that obvious that we can write fractions mod n that way?
31.07.2013 19:17
Peter wrote: (Wolstenholme's Theorem) Prove that if \[1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{p-1}\] is expressed as a fraction, where $p \ge 5$ is a prime, then $p^{2}$ divides the numerator. $1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{p-1}\ = \sum_{i=1}^{\frac{p-1}{2}} (\frac{1}{i}+\frac{1}{p-i}) = \sum_{i=1}^{\frac{p-1}{2}} \frac{p}{i(p-i)}$. So it'a enough to show that $\sum_{i=1}^{\frac{p-1}{2}} \frac{1}{i(p-i)} \equiv 0 \mod{p}$. $\sum_{i=1}^{\frac{p-1}{2}} \frac{1}{i^2}=0$. It's obviously that if $i^2 \equiv j^2 \mod{p}$. Than $i \equiv j$, if $0<i,j<\frac{p+1}{2}$. So that summ is equivalent to $\frac{1}{x_1}+\cdots+\frac{1}{x_\frac{p-1}{2}}$, where $x_1, \cdots , x_\frac{p-1}{2}$ is all quadratic resedues $\mod{p}$. But $\frac{1}{x_i}$ is also quadratic resedue, so we need to show that $x_1+\cdots+x_\frac{p-1}{2} \equiv 0 \mod{p}$. We can do it using 2 ways: 1. Let $S$ be that sum, and let $x_j$ be a quadratic resedue more than 1, than $S\equiv x_jS \mod{p}$, because $x_ix_j$ is quadratic resedue. Than $S\equiv 0 \mod{P}$. Q.E.D. 2. Let $e$ be a primitive root modulo $p$. Than all quadratic resedues is $e^{2k}$. So we need to show that $e^2+\cdots + (e^2)^\frac{p-1}{2} \equiv 0 \mod{p}$. $\frac{(e^2)^\frac{p+1}{2}-1}{e^2-1}-1$ the last one is $0$ by the Fermat's theorem.
10.12.2016 11:03
well to prove the lemma that Duelist said, ( 1^k + 2^k +... + p^k = 0 (mode p) if p-1 doesn't divide k) there is an easier way than what he has said in that page. we know every odd prime number has primitive root . So if we let g be the primitive root of p , we know for each i , 1=< i =< p-1 , there exists a g^Si in {1 , g , g^2 .... g^φ(p)-1 } that i = g^Si ( mode p ). So 1^k + 2^k +... + p^k = 1^k + 2^k +... +(P-1)^K = g^kS1 + g^kS2 + .... + g^kSp-2. (mode p) We let T= 1 + g^k + g^2k + ... + g^(p-2)k. Then T(g^k - 1) = (g^(p-1)k - 1) , and we know p divides the right side, so it must divide the left side too. But p -1 doesn't divide k , so p doesn't divide g^k - 1 , So p divides T.
02.10.2017 02:36
Wow, this is totally amazing!
07.10.2017 06:01
111111111111111111111111111111111111111111111111111111111111111111111111111
08.04.2020 12:22
because of Euler's theorem we can say: $\sum_{i=1}^{p-1} \frac{1}{i} \equiv \sum_{i=1}^{p-1} i^{p^2-p-1} = \sum_{i=1}^{\frac{p-1}{2}} (i^{p^2-p-1}+(p-i)^{p^2-p-1}) \equiv \sum_{i=1}^{\frac{p-1}{2}} (-p)\times i^{p^2-p-2} \mod{p^2} $ so $\sum_{i=1}^{p-1} \frac{1}{i} \equiv 0 \mod{p^2}$ if and only if $ \sum_{i=1}^{\frac{p-1}{2}} i^{p^2-p-2} \equiv 0 \mod{p}$ $ i^{p^2-p-2} \equiv (p-i)^{p^2-p-2} $ which implies $ \sum_{i=1}^{\frac{p-1}{2}} i^{p^2-p-2} \equiv 0 \mod{p} $ if and only if $ \sum_{i=1}^{p-1} i^{p^2-p-2} \equiv 0 \mod{p}$ and with lemma $1^k + 2^k + \cdots + (p - 1)^k \equiv 0 \pmod{p}$ whenever $p - 1$ does not divide $k$ we're done!