Wolstenholme's theorem is stated as follows:
if $p>3$ is a prime, then
\begin{align\*}
\sum\_{k=1}^{p-1}\frac{1}{k}\equiv 0 \pmod{p^2},\\
\sum\_{k=1}^{p-1}\frac{1}{k^2} \equiv 0 \pmod{p}.
\end{align\*}
It is also not hard to prove that
$$
\sum\_{k=1}^{p-1}\frac{(-1)^k}{k^2}\equiv 0 \pmod{p}.
$$
However, there are some relationships between $\sum\_{k=1}^{p-1}\frac{(-1)^k}{k^2}$ and $\sum\_{k=1}^{p-1}\frac{1}{k^2}$ mod $p^2$, which I can not prove.


**Question:**
If $p$ is an odd prime, then
$$
4\sum\_{k=1}^{p-1}\frac{(-1)^k}{k^2}\equiv 3\sum\_{k=1}^{p-1}\frac{1}{k^2}\pmod{p^2}.
$$
I have verified this congruence for $p$ upto $7919$.


**Comments:** 


(1) Since 
$$4\sum\_{k=1}^{p-1}\frac{(-1)^k}{k^2}=2\sum\_{k=1}^{\frac{p-1}{2}}\frac{1}{k^2}-4\sum\_{k=1}^{p-1}\frac{1}{k^2},$$
we need to prove
$$2\sum\_{k=1}^{\frac{p-1}{2}}\frac{1}{k^2}\equiv 7\sum\_{k=1}^{p-1}\frac{1}{k^2} \pmod{p^2}.$$
This idea was given by Fedor Petrov.


(2) It is interesting that the congruence in the question is ture mod $p^3$ for $p\ge 7$, i.e.,
$$
4\sum\_{k=1}^{p-1}\frac{(-1)^k}{k^2}\equiv 3\sum\_{k=1}^{p-1}\frac{1}{k^2}\pmod{p^3}, \quad \text{for $p\ge 7$}.
$$
This was conjectured by tkr.


I appreciate any proofs, hints, or references!



Prove $4\sum_{k=1}^{p-1}\frac{(-1)^k}{k^2}\equiv 3\sum_{k=1}^{p-1}\frac{1}{k^2}\pmod{p^2}$
This goes way back to Emma Lehmer, see her [elementary paper](http://gradelle.educanet2.ch/christian.aebi/.ws_gen/14/Emma_Lehmer_1938.pdf) on Fermat quotients and Bernoulli numbers from 1938.


Assume $p\ge 7$. First, I reformulate your congruence. I replace
$$4\sum\_{k=1}^{p-1}\frac{(-1)^k}{k^2}\equiv 3\sum\_{k=1}^{p-1}\frac{1}{k^2}\pmod{p^3}$$
with the equivalent
$$\sum\_{k=1}^{p-1} \frac{1}{k^2} \equiv 8\sum\_{k=1}^{\frac{p-1}{2}}\frac{1}{(p-2k)^2}\pmod{p^3}$$


Lehmer has proved the following, see equation (19) in the linked paper:
$$\sum\_{k=1}^{\frac{p-1}{2}} (p-2k)^{2r} \equiv p 2^{2r-1} B\_{2r} \pmod {p^3}$$
(valid when $2r \not\equiv 2 \pmod {p-1}$). Plugging $2r=p^3-p^2-2$, we get


$$\sum\_{k=1}^{\frac{p-1}{2}} (p-2k)^{p^3-p^2-2} \equiv p 2^{p^3-p^2-3} B\_{p^3-p^2-2} \pmod {p^3}$$
Now use Euler's theorem to replace $x^{p^3-p^2-2}$ with $x^{-2}$:


$$\sum\_{r=1}^{\frac{p-1}{2}} \left(\frac{1}{p-2k}\right)^2 \equiv p 2^{-3} B\_{p^3-p^2-2} \pmod {p^3}$$


So your congruence becomes
$$(\*)\qquad \sum\_{k=1}^{p-1} \frac{1}{k^2} \equiv pB\_{p^3-p^2-2} \pmod {p^3}$$


This was also proved in Lehmer's paper - in equation (15) she writes
$$\sum\_{k=1}^{p-1} k^{2r} \equiv pB\_{2r} \pmod {p^3}$$
(valid when $2r \neq 2 \mod {p-1}$). Plugging $2r=p^3-p^2-2$ and using Euler's theorem, we get the desired result.




---


It is now easy to generalize - when $2r \not\equiv 2 \pmod {p-1}$, we have
$$\sum\_{k=1}^{p-1} (-1)^k k^{2r} \equiv (1-2^{2r}) \sum\_{k=1}^{p-1} k^{2r} \pmod {p^3}$$


Plugging $2r=p^3-p^2-2c$ ($c \not\equiv -1 \pmod {\frac{p-1}{2}}$) we get
$$\sum\_{k=1}^{p-1} \frac{(-1)^k}{k^{2c}} \equiv (1-2^{-2c}) \sum\_{k=1}^{p-1} \frac{1}{k^{2c}} \pmod {p^3}$$




---


To get a taste of things, I include a proof of $(\*)$. Via Faulhaber's formula for sum of powers, we get:
$$\sum\_{k=1}^{p-1} \frac{1}{k^2} \equiv \sum\_{k=1}^{p-1} k^{p^3-p^2-2} \equiv \sum\_{k=1}^{p} k^{p^3-p^2-2} = $$
$$\frac{1}{p^3-p^2-1} \sum\_{j=0}^{p^3-p^2-2}\binom{p^3-p^2-1}{j}B\_j p^{p^3-p^2-1-j} \pmod {p^3}$$
Note that odd-indexed Bernoulli's vanish, and that by the Von Staudt–Clausen theorem, the even-indexed Bernoulli's have $p$ in the denominator with multiplicity $\le 1$. Additionally, $B\_{p^3-p^2-4}$ is $p$-integral (since $p-1 \nmid p^3-p^2-4$).


Hence, for the purpose of evaluating the sum modulo $p^3$, we can drop almost all the terms and remain only with the last one:
$$\sum\_{k=1}^{p-1} \frac{1}{k^2} = \frac{1}{p^3-p^2-1} \binom{p^3-p^2-1}{p^3-p^2-2} B\_{p^3-p^2-2} p = pB\_{p^3-p^2-2} \pmod {p^3}$$


