# How can prove this $\sum_{k=0}^{p}\binom{p}{k}(\pm i\sqrt{3})^k\equiv 1\pm (i\sqrt{3})^p-p\sum_{k=1}^{p-1}\frac{(\mp i\sqrt{3})^k}{k}(mod p^2)?$

for any prime $p>3$,show that : $$p\sum_{j=0}^{p-1}\dfrac{(-3)^j}{2j+1}\equiv \left(\dfrac{p}{3}\right)(mod p^2)$$ where $\left(\dfrac{p}{3}\right)$meaning Legendre symbol.

This is proof: we have $$(1\pm i\sqrt{3})^p=2^pe^{\pm i\pi p/3}=2^p(\cos{(\pi p/3)}\pm i\sin{(\pi p/3)}=2^{p-1}\left(1\pm i\left(\dfrac{p}{3}\right)\sqrt{3}\right)$$ on the other hand ,we have \begin{align*} (1\pm i\sqrt{3})^p=\sum_{k=0}^{p}\binom{p}{k}(\pm i\sqrt{3})^k&\equiv 1\pm (i\sqrt{3})^p-p\sum_{k=1}^{p-1}\dfrac{(\mp i\sqrt{3})^k}{k}\\ &\equiv 1\pm i\sqrt{3}(-3)^{(p-1)/2}-S_{0}\pm i\sqrt{3}S_{1}(mod p^2) \end{align*} wehre $$S_{0}=p\sum_{j=1}^{\frac{p-1}{2}}\dfrac{(-3)^j}{2j},S_{1}=p\sum_{j=0}^{\frac{p-3}{2}}\dfrac{(-3)^j}{2j+1}$$ then $$S_{0}\equiv 1-2^{p-1}(mod p^2), S_{1}\equiv 2^{p-1}\left(\dfrac{p}{3}\right)-(-3)^{(p-1)/2}(mod p^2)$$ so \begin{align*} p\sum_{j=0}^{p-1}\dfrac{(-3)^j}{2j+1}&=p\sum_{j=0}^{(p-3)/2}\dfrac{(-3)^j}{2j+1}+(-3)^{(p-1)/2}+(-3)^{(p-1)/2}p\sum_{j=1}^{(p-1)/2}\dfrac{(-3)^j}{p+2j}\\ &\equiv S_{1}+(-3)^{(p-1)/2}+(-3)^{(p-1)/2}S_{0}\\ &\equiv (2^{p-1}-1)\left(\left(\dfrac{p}{3}\right)-(-3)^{(p-1)/2}\right)+\left(\dfrac{p}{3}\right)\\ &\equiv \left(\dfrac{p}{3}\right)(mod p^2) \end{align*} where use $$p|(2^{p-1}-1),2|\left(\left(\dfrac{p}{3}\right)-(-3)^{(p-1)/2}\right)$$ \

my question:

(1)：why $$\sum_{k=0}^{p}\binom{p}{k}(\pm i\sqrt{3})^k\equiv 1\pm (i\sqrt{3})^p-p\sum_{k=1}^{p-1}\dfrac{(\mp i\sqrt{3})^k}{k}(mod p^2)?$$ (2): why $$S_{0}\equiv 1-2^{p-1}(mod p^2), S_{1}\equiv 2^{p-1}\left(\dfrac{p}{3}\right)-(-3)^{(p-1)/2}(mod p^2)?$$

Thank you someone can solve my two problem,Thank you very much,and this $$p\sum_{j=0}^{p-1}\dfrac{(-3)^j}{2j+1}\equiv \left(\dfrac{p}{3}\right)(mod p^2)$$ have other methods? Thank you

-
What do you mean by $modp^2$ –  Alizter Jul 30 '13 at 10:15