Question on Summation Formula for Fermat Quotients According to Wolfram (https://mathworld.wolfram.com/FermatQuotient.html),
$\displaystyle \frac{2^{p-1}-1}{p}=\frac{1}{2}\sum_{n=1}^{p-1}\frac{\left(-1\right)^{n-1}}{n}$
I am struggling to understand how the sum is derived because the RHS converges to $\frac{1}{2}\ln2$ as $p\rightarrow\infty$. However, Fermat quotients diverge. I would be grateful for any help on this.
 A: The meaning of $\frac1a \pmod m$
The idea behind the notation $\frac 1a$ modulo $m$ comes from ring theory (Please use the Wikipedia pages for groups and rings to get in touch with these concepts). Indeed, the integers $0,...,m-1$ form a group under operation $a + b = c$ where $c$ is the remainder when $a+b$ (the usual sum) is divided by $m$, and under the multiplication operator $a \cdot b =  c$ where $c$ is the remainder when $a\cdot b$ (the usual product) is divided by $m$.
Now, $1$ is called the multiplicative identity , because $a \cdot 1 =a$ for any $a$. In correspondence with group theoretic reasoning, we call an element $a \in \{0,...,m-1\}$ invertible if there is a $b$ such that $a \cdot b = 1$. That is, if there is an integer $b \in \{0,1,...,m-1\}$ such that $a \cdot b$ leaves a remainder of $1$ when divided by $m$.
It can be proven that the inverse, if it exists, is unique. The notation of the inverse of $a$ , if it exists, is either $\frac 1a$ or $a^{-1}$.
Now, there is an easy result for when $a$ is invertible in $\{0,...,m-1\}$ (we call this as invertibility modulo $m$).

$a$ is invertible if and only if $\gcd(a,m) = 1$.

So $\frac 1a$ is a valid element of $\{0,1,...,m-1\}$ whenever $a$ is coprime to $m$.

$\textbf{A SMALL CAVEAT}$ : The quantity $\frac{2^{p-1}-1}{p}$ is an actual division by $p$. You can see that $\gcd(p,p) = p \neq 1$ so $\frac 1p$ doesn't make sense modulo $p$. That is an actual division by $p$. I will show this in my example below. It is an abuse of notation of $\frac{\cdot}{\cdot}$ to represent both actual division and modulo division, and we should be careful of this in general. You can ask if $\frac{2^{p-1}-1}{p}$ will always be an integer : this is true by Fermat's little theorem.

Examples

*

*Let $m=5$ and $a=2$. Then $\gcd(2,5) = 1$ so $\frac 12$ is a well defined element modulo $5$. Can we find it? By experimenting, $2 \cdot 3 = 6$ leaves remainder $1$ upon division by $5$, so $3 = \frac 12$ modulo $5$. In particular, when we are dealing with the ring of integers modulo $5$, and we see $\frac 12$ somewhere, it actually stands for $3$.


*Let $m =15$ and $a = 8$. Then $\gcd(8,15) = 1$ and you can see that $\frac 18 = 2$.


*Let $m = 16$ and $a=10$. Then $\gcd(10,16) \neq 1$ so $\frac 1{10}$ cannot be defined or talked about modulo $16$.


*Let $m$ be a prime, and $a \neq 0$. Then $\gcd(a,m) = 1$ so $\frac 1a$ always exists, although one can find it only by experimentation or algorithms like reversing the Euclidean algorithm.
On the identity in the question
Thus, what does the identity mean finally? Well, the RHS is not a real number, but rather an integer modulo $p$. The only way to illustrate this is to actually compute both the sides for a certain prime $p$. We will compute each term separately. Let's go with $p=5$.

*

*LHS : $\frac{2^{p-1}-1}{p} = \frac{2^4-1}{5} = 3$, an actual division, remember the caveat.


*RHS : We have $\frac 12 = 3$. Then for each of $n=1$ to $4$ we compute $\frac{(-1)^{n-1}}{n}$. For $n=1$, $\frac {(-1)^0}{1} = \frac 11 = 1$. Then for $n=2$ we have $\frac{(-1)^1}{2} = -\frac{1}{2}= -3 = 2$. For $n=3$ we have $\frac{(-1)^2}{3} = \frac 13 = 2$. For $n=4$ we have $\frac{(-1)^3}{4} = \frac {-1}4 = -4 = 1$ (since $4\times 4 = 16 = 1$). So the sum finally is $3(1+2+2+1) = 3 \cdot 6 = 18 =3$.
So both RHS and LHS are equal to $3$ modulo $5$. That is how you would read that identity.
Historical significance
So what's the fuss about this whole identity? Well, it comes from Fermat's last theorem. Recall the Fermat's last theorem : for every $n \geq 3$ there are no positive integers $x,y,z$ with $x^n+y^n=z^n$.
It is easy to prove that Fermat's last theorem is true if and only if it is true for $n$ taking just prime values, $n>2$. So we can study each prime. While studying each prime, the Fermat quotient comes up, in a way that I can't explain but is illustrative.
Wieferich proved in 1909 that if the FLT was contradicted for $n=p$, then it is necessary that $\frac{2^{p-1}-1}p = 0 \pmod{p}$. That is, we must have that the Fermat quotient for $p$ with base $2$ must be equal to $0$. This generated interest in the identity given because it naturally provided a different way of computing the Fermat quotient.
Only two primes (such primes with Fermat quotient with base $2$ equal to $0$ are called Wieferich primes) are known! They are $1093$ and $3511$.
The result does not stay true for only base $2$ : it was later extended to all prime bases up to $89$. That is : if there is a counterexample of FLT for $n=p$ then the Fermat quotient of $p$ with base $k$ must be zero for all primes $k$ from $2$ to $89$! If only we could show that no such prime existed, we'd be done, but this has been elusive.
Proof of the identity
The proof of the identity is not easy, because it involves some manipulations that you will not be able to get at first glance. So I will not include it here. Instead, I will ask you to visit the post here, which goes through the proof of a very similar identity. You can attempt to use the proof there to prove this.
The main idea is to get yourself comfortable with arithmetic modulo $p$. This is necessary before you can understand the above identity.
