# congruent to mod p $1^{p-2}+2^{p-2}+\cdots+\left(\frac{p-1}{2}\right)^{p-2}\equiv\frac{2-2^p}{p}\pmod p.$

Let $p$ be an odd prime.How to prove that

$$1^{p-2}+2^{p-2}+\cdots+\left(\frac{p-1}{2}\right)^{p-2}\equiv\frac{2-2^p}{p}\pmod p.$$

-
Let $f(x)=(x+1(\frac{p-1}{2}))(x+2(\frac{p-3}{2})...(x+(\frac{p-1}{2})(1))$,and $a=$ coefficient of $x$ of $f(x)$. Then the problem is equivalent to showing that $a\equiv 8(-1)^{\frac{p-1}{2}} (\frac{2^{p-1}-1}{p}) (mod p)$. I dunno if this would help us solve this problem. –  Ben Jun 30 '12 at 9:53
Am I being stupid or does this not make sense since $p$ is not invertible mod $p$? –  fretty Jun 30 '12 at 12:29
$2-2^p$ is divisible by $p$,so here $\frac{2-2^p}{p}$ is an integer and $\frac{1}{p}$ does not mean the inverse in the field $\mathbb{Z}/p\mathbb{Z}$. –  Ben Jun 30 '12 at 12:30
Yes, I didn't look at the numerator in detail so I was being stupid. –  fretty Jun 30 '12 at 12:40

I find that this identity is stated in this paper:

Lehmer, E. "On Congruences Involving Bernoulli Numbers and the Quotients of Fermat and Wilson." Ann. Math. 39, 350-360, 1938 : http://www.jstor.org/discover/10.2307/1968791?uid=2134&uid=2&uid=70&uid=4&sid=56284309973

EDIT:

In fact,we can use a simpler method to solve this problem.

Let $q(a)=\frac{a^{p-1}-1}{p}$ for all $a$ such that $\gcd(a,p)=1$. It is not difficult to show that $q(ab) \equiv q(a)+q(b) \pmod{p}...(1)$.

Let $a$ be an arbitrary integer which is relatively prime to $p$. For each $v \in \{1,2,...,p-1\}$,let $av=\lfloor{\frac{av}{p}} \rfloor p+r_v$. Then we can see that $r_v$,($r=1,2,...,p-1$) also runs over ${1,2,...,p-1}$. So $q(av)=((\lfloor{\frac{av}{p}} \rfloor p+r_v)^{p-1}-1)/p\equiv q(r_v)-\lfloor{\frac{av}{p}} \rfloor r_v^{p-2} \equiv q(r_v)-\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor \pmod{p}$

So, $\sum_{v=1}^{p-1} q(av) \equiv \sum_{v=1}^{p-1} (q(r_v)-\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor)\equiv \sum_{v=1}^{p-1} q(v)-\sum_{v=1}^{p-1}\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor \pmod{p}...(2)$

Then by $(1),(2)$,we get $q(a) \equiv \sum_{v=1}^{p-1}\frac{1}{av} \left \lfloor \frac{av}{p} \right \rfloor \pmod{p}...(3)$

Take $a=2$, $\frac{2^p-2}{p} \equiv \sum_{v=1}^{p-1}\frac{1}{v} \left \lfloor \frac{2v}{p} \right \rfloor \equiv \sum_{p/2 <v} \frac{1}{v} \equiv -\sum_{v=1}^{(p-1)/2} \frac{1}{v} \equiv -\sum_{v=1}^{(p-1)/2} v^{p-2} \pmod{p}$

As a result,

$1^{p-2}+2^{p-2}+\cdots+\left(\frac{p-1}{2}\right)^{p-2}\equiv\frac{2-2^p}{p}\pmod p.$

-
–  anon Jun 30 '12 at 12:45
BenLi,could you look at this solution : store2.up-00.com/June12/RoL51753.jpg –  Frank Jul 2 '12 at 17:56
@MohammedAl-mubark, your solution looks alright. That's how I did it. Look below. –  DonAntonio Jul 3 '12 at 1:50
@Mohammed Al-mubark:your solution looks much simpler and more direct. –  Ben Jul 3 '12 at 2:00
$$2^p=(1+1)^p=\sum_{k=0}^p\binom {p}{k}=\left[\binom{p}{0}+\binom{p}{p}\right]+\ldots+\left[\binom{p}{\frac{p-1}{2}}+\binom{p}{\frac{p+1}{2}}\right]=$$ $$=2\left[\binom{p}{0}+\ldots+\binom{p}{\frac{p-1}{2}}\right]$$