\documentclass[12pt]{article}
\textwidth= 6.5in
\textheight= 9.0in
\topmargin = -20pt
\evensidemargin=0pt
\oddsidemargin=0pt
\headsep=25pt
\parskip=10pt
\font\smallit=cmti10
\font\smalltt=cmtt10
\font\smallrm=cmr9

\usepackage{amssymb, amsmath, amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{proposition}{Proposition}
%\numberwithin{equation}{section}

\begin{document}
\vspace*{-40pt} 
\centerline{\smalltt INTEGERS: 
 \smallrm ELECTRONIC JOURNAL OF COMBINATORIAL NUMBER THEORY \smalltt 6 
(2006), \#A24} 
\vskip 40pt
\begin{center}
{\bf THE CUBE OF THE FERMAT QUOTIENT}
\vskip 20pt
{\bf Karl Dilcher\footnote{Supported by the Natural Sciences and
Engineering Research Council of Canada.}}\\
{\smallit Department of Mathematics and Statistics, Dalhousie University,
Halifax, Nova Scotia, B3H 3J5, Canada}\\
{\tt dilcher@mathstat.dal.ca}\\
\vskip 10pt
{\bf Ladislav Skula\footnote{Supported by the Grant Agency of the
Czech Republic (Methods of Theory of Numbers, 201/04/381).}}\\
{\smallit Department of Applied Mathematics, Faculty of Science,
Masaryk University in Brno, Jan\'a\v{c}kovo n\'am.~2a,
602\,00 Brno, Czech Republic}\\
{\tt skula@math.muni.cz}\\
\end{center}
\vskip 30pt
\centerline{\smallit Received: 11/30/05, Revised: 6/14/06,
 Accepted: 7/24/06,
Published: 10/06/06}
\vskip 30pt

\centerline{\bf Abstract}

We prove a certain polynomial congruence modulo an odd prime $p\geq 5$,
and as a consequence we obtain a congruence for the cube of the Fermat
quotient to base 2 in terms of simple finite sums. This extends known
results of a similar nature for the first and second powers of the
Fermat quotient.

\noindent

\pagestyle{myheadings}
\markright{\smalltt INTEGERS: \smallrm ELECTRONIC JOURNAL
 OF COMBINATORIAL NUMBER THEORY \smalltt 6 (2006), \#A24\hfill}

\thispagestyle{empty}
\baselineskip=15pt
\vskip 30pt

\section*{\normalsize 1. Introduction}

For an odd prime $p$ and an integer $a$ with $p\nmid a$ the 
{\it Fermat quotient\/} of $p$ to base $a$ is defined by
\begin{equation}\label{1a}
q_p(a) := \frac{a^{p-1}-1}{p}.
\end{equation}
Because of their close connection to the classical theory of Fermat's last
theorem these quotients have been studied in great detail (see, e.g., 
\cite{Ri}), and a large number of congruences for them are known. 
A particularly interesting one, due to Glaisher \cite{Gl}, is
\begin{equation}\label{1b}
q_p(2) \equiv -\frac{1}{2} \sum_{j=1}^{p-1} \frac{2^j}{j} \pmod{p}. 
\end{equation}    
Recently the second author discovered and conjectured 
\begin{equation}\label{1c}
q_p(2)^2 \equiv -\sum_{j=1}^{p-1} \frac{2^j}{j^2} \pmod{p},
\end{equation} 
and subsequently Granville \cite{Gr} proved this congruence. Granville also
remarked that, based on calculations, an obvious extension of (\ref{1b}) and
(\ref{1c}) probably does not exist.
However, it turns out that a less obvious extension to $q_p(2)^3$, involving
two sums of the expected type, does exist. It is the purpose of this paper 
to prove this congruence, namely

\begin{theorem}
For any prime $p\geq 5$ we have
\begin{equation}\label{1d}
q_p(2)^3 \equiv -3\sum_{j=1}^{p-1} \frac{2^j}{j^3} 
+\frac{7}{4} \sum_{j=1}^{p-1} \frac{(-1)^j}{j^3}\pmod{p},
\end{equation}
or equivalently
\begin{equation}\label{1e}
q_p(2)^3 \equiv -3\sum_{j=1}^{p-1} \frac{2^j}{j^3}
+\frac{7}{16} \sum_{j=1}^{\frac{p-1}{2}}\frac{1}{j^3}\pmod{p}.
\end{equation}
\end{theorem}
The proof of this result uses methods similar to those in \cite{Gr}; this 
part is done in Section~2. The remainder of the proof is then presented in
two versions. In Section~3 we present a short proof by the anonymous referee.
Our own proof relies on some general results, proved in Section~4, concerning
certain sums modulo $p$; we consider this of independent interest.
Section~5 then concludes the second proof.

Congruences (\ref{1b}) -- (\ref{1d}) give rise to the obvious question
whether there exist similar formulas also for higher powers of $q_p(2)$.
On the one hand, computer searches have been without success, while on
the other hand the method of Section~2 below does not appear to extend 
to higher powers.

\vskip 30pt

\section*{\normalsize 2. Proof of Theorem~1}

As in \cite{Gr}, we define the following polynomials:
\begin{align}
q(x) &:= \frac{x^p-(x-1)^p-1}{p},\label{1} \\
G(x) &:= \sum_{j=1}^{p-1} \frac{x^j}{j^2}, \label{3}
\end{align} 
and the additional polynomial
\begin{equation}\label{4}
G_3(x) := \sum_{j=1}^{p-1} \frac{x^j}{j^3}.
\end{equation} 
We also use the congruences (4) and (5) in \cite{Gr}, namely
\begin{gather}
G(x) \equiv G(1-x) + x^pG(1-\tfrac{1}{x}) \pmod{p},\label{5}\\
q(x)^2 \equiv -2x^pG(x) - 2(1-x^p)G(1-x) \pmod{p}.\label{6}
\end{gather}   
We are now ready to state the following result which provides the main step 
towards the proof of Theorem~1. It can be seen as the cubic analogue of
(\ref{6}) and is of interest in its own right.

\begin{theorem}
For any prime $p\geq 5$ we have
\begin{align}
\frac{1}{6}q(x)^3 &\equiv -x^pG_3(x)-(1-x^p)G_3(1-x)
-x^{2p}(1-x^p)G_3(1-\tfrac{1}{x}) \label{6a} \\
&\qquad -\frac{2}{3}G_3(-1)x^p(1-x^p) \pmod{p}. \nonumber
\end{align}
\end{theorem}

\begin{proof}[Proof of Theorem~1]
We specialize (\ref{6a}) by setting $x=2$. Then it is obvious
from (\ref{1}) that
\begin{equation}\label{14b}
q(2) \equiv 2q_p(2) \pmod{p}.
\end{equation}
Also, with (\ref{4}) we have
\begin{equation}\label{15}
x^pG_3(\tfrac{1}{x})=\sum_{j=1}^{p-1}\frac{x^{p-j}}{j^3}
=\sum_{j=1}^{p-1}\frac{x^j}{(p-j)^3} \equiv -G_3(x) \pmod{p},
\end{equation}
so that
\begin{equation}\label{16}
2^pG_3(\tfrac{1}{2}) \equiv -G_3(2) \pmod{p}.
\end{equation}
Finally, if we note that $2^p \equiv 2 \pmod{p}$, we get
\begin{equation}\label{17}
q_p(2)^3 \equiv -3G_3(2)+\frac{3}{4}G_3(-1)
-\frac{3}{2}\left(-\frac{2}{3}G_3(-1)\right) \pmod{p}.
\end{equation}
This is obviously (\ref{1d}); the equivalence to (\ref{1e}) will be shown
in Proposition~5 below.
\end{proof}

In the remainder of this section we will give the first half of the proof
of Theorem~2. We begin by noting that from (\ref{1}) it follows that
\begin{equation}\label{7}
q'(x) \equiv -\sum_{j=1}^{p-1}x^{j-1} = x^{p-1} - \frac{1-x^p}{1-x} \pmod{p}
\end{equation} 
(see also \cite[p.~2]{Gr}). Also, from (\ref{3}) and (\ref{4}) it is 
obvious that
\begin{equation}\label{8}
G_3'(x) = \frac{1}{x}G(x).
\end{equation} 

Adapting the main idea of proof in \cite{Gr}, we use (\ref{6}) and
(\ref{7}) to obtain
\begin{align}
\frac{d}{dx}q(x)^3 &= 3q(x)^2q'(x) \label{9} \\
&\equiv 3\bigl(-2x^pG(x)-2(1-x^p)G(1-x)\bigr)
\left(x^{p-1}-\frac{1-x^p}{1-x}\right) \nonumber \\
&=-6x^{2p}\frac{G(x)}{x} + 6(1-x^p)^2\frac{G(1-x)}{1-x} \nonumber \\
&\qquad +6x^p(1-x^p)\left(\frac{G(x)}{1-x}-\frac{G(1-x)}{x}\right)\pmod{p}.
\nonumber
\end{align}
With (\ref{5}) we now get
%\begin{align*}
$$
\frac{G(x)}{1-x} \equiv\frac{G(1-x)+x^pG(1-\tfrac{1}{x})}{1-x} 
=\frac{G(1-x)}{1-x}-x^p\frac{1}{x}\frac{G(1-\tfrac{1}{x})}{1-\tfrac{1}{x}}\pmod{p}
$$
%\end{align*}
and
%\begin{align*}
$$
\frac{G(1-x)}{x} \equiv\frac{G(x)-x^pG(1-\tfrac{1}{x})}{x} 
=\frac{G(x)}{x}-x^p\left(\frac{1}{x}-\frac{1}{x^2}\right)
\frac{G(1-\tfrac{1}{x})}{1-\tfrac{1}{x}}\pmod{p},
$$
%\end{align*}
so that
\begin{equation}\label{10}
\frac{G(x)}{1-x}-\frac{G(1-x)}{x}
\equiv \frac{G(1-x)}{1-x}-\frac{G(x)}{x}
-x^p\frac{1}{x^2}\frac{G(1-\tfrac{1}{x})}{1-\tfrac{1}{x}}\pmod{p}.
\end{equation}
Combining (\ref{9}) and (\ref{10}), we obtain after some simplification,
\begin{equation}\label{11}
\frac{1}{6}\frac{d}{dx}q(x)^3 
\equiv -x^p\frac{G(x)}{x}+(1-x^p)\frac{G(1-x)}{1-x}
-x^{2p}(1-x^p)\frac{1}{x^2}\frac{G(1-\tfrac{1}{x})}{1-\tfrac{1}{x}}\pmod{p}.
\end{equation} 

Now the essential step consists of taking the antiderivative on
both sides of (\ref{11}), using (\ref{8}):
\begin{align}
\frac{1}{6}q(x)^3 &\equiv -x^pG_3(x)-(1-x^p)G_3(1-x)
-x^{2p}(1-x^p)G_3(1-\tfrac{1}{x}) \label{12} \\
&\qquad +c_0+c_1x^p+c_2x^{2p}\pmod{p}. \nonumber
\end{align}
Here we have used the fact that the only powers of $x$ occurring in (\ref{11})
are powers of $x^p$, and the constants $c_0, c_1, c_2$ come from the fact that
the polynomials on both sides of (\ref{12}) have degree $<3p$. To determine 
these constants we note that, as observed in \cite{Gr}, we have
\begin{equation}\label{13}
q(0) \equiv q(1) \equiv 0 \pmod{p},
\end{equation}  
but also
\begin{equation}\label{14}
G_3(0) \equiv G_3(1) \equiv  0 \pmod{p},
\end{equation} 
by a well-known congruence which is easy to prove. If we set $x=0$ in 
(\ref{12}) and note that $x^pG_3(1-\tfrac{1}{x})$ is actually a polynomial
in $x$, then we see that each term, with the exception of $c_0$, is
congruent to $0\pmod{p}$; hence
$c_0 \equiv 0\pmod{p}$.
Similarly, if we set $x=1$ in (\ref{12}) then by (\ref{13}) and (\ref{14})
we have 
$c_1+c_2 \equiv 0\pmod{p}$,
so that (\ref{12}) becomes
\begin{align}
\frac{1}{6}q(x)^3 &\equiv -x^pG_3(x)-(1-x^p)G_3(1-x)
-x^{2p}(1-x^p)G_3(1-\tfrac{1}{x}) \label{14a} \\
&\qquad + c_1x^p(1-x^p) \pmod{p}. \nonumber
\end{align}
It is important to note that $c_1$ is a constant that still depends on the
prime $p$.

Thus it remains to evaluate the constant $c_1 \pmod{p}$. 
The main idea of both proofs rests on the fact that the function $q(x)$ has, 
in addition to $x=0$ and $x=1$, another zero in ${\mathbb Z}/p{\mathbb Z}$,
or in an extension of this field. 

\vskip 30pt

\section*{\normalsize 3. First Proof of Theorem~2}

The following determination of the constant $c_1$, which completes the
proof of Theorem~2, is due to the referee.

The congruence (\ref{14a}) can be seen as an identity in ${\mathbb Q}[x]$
if we add a polynomial with rational coefficients whose numerators are all
divisible by $p$. Now let $a$ be a primitive sixth root of unity in
${\mathbb C}$, which means its minimal polynomial is $x^2-x+1$. Then
$a-1=a^2$, and so $a^p-(a-1)^p-1=-((a^p)^2-a^p+1)=0$ since $a^p$ is also
a primitive sixth root of unity, and thus $q(a)=0$ by the definition
(\ref{1}). Since $a^p(1-a^p)=1$
and $1-\frac{1}{a}=a$, as well as $1-a=\overline{a}$ and $1-a^p=\overline{a}^p$
with $\overline{a}$ the conjugate of $a$, (\ref{14a}) with $x=a$ gives
\begin{equation}\label{3.1}
c_1 \equiv 2a^pG_3(a) + \overline{a}^pG_3(\overline{a}) \pmod{p}.
\end{equation}
Replacing $a$ by $\overline{a}$ and comparing with (\ref{3.1}), we get
$a^pG_3(a) \equiv \overline{a}^pG_3(\overline{a}) \pmod{p}$, and therefore
\begin{equation}\label{3.2}
c_1 \equiv 3a^pG_3(a) \pmod{p}.
\end{equation}
Now we define, for any integer $r$,
\begin{equation}\label{3.3}
t(r):=\sum_{\substack{j=1\\ j\,\equiv\,r\!\!\!\pmod{6}}}^{p-1}\frac{1}{j^3};
\end{equation}
then $t(R)=t(r)$ if $R\equiv r\pmod{6}$. Note that
\begin{equation}\label{3.4}
G_3(-1)=\sum_{j=0}^5(-1)^jt(j) \equiv 2\bigl(t(0)+t(2)+t(4)\bigr),
\end{equation}
and that 
\begin{align*}
t(0)+t(2)+t(4)
&=\sum_{\substack{j=1\\ j\,\equiv\,0\!\!\!\pmod{2}}}^{p-1}\frac{1}{j^3}
\equiv \sum_{\substack{j=1\\ j\,\equiv\,0\!\!\!\pmod{6}}}^{3p-1}\frac{1}{j^3}\\
&=3^3\sum_{i=0}^2
\sum_{\substack{j=ip+1\\ j\,\equiv\,0\!\!\!\pmod{6}}}^{(i+1)p}\frac{1}{j^3}
=3^3\sum_{i=0}^2
\sum_{\substack{k=1\\ k\,\equiv\,-ip\!\!\!\pmod{6}}}^{p}\frac{1}{j^3}\\
&=27\bigl(t(0)+t(-p)+t(-2p)\bigr)\pmod{p},
\end{align*}
where we have written $j=k+ip$. From the definition (\ref{3.3}) we also have
$t(j)\equiv -t(p-j)\pmod{p}$. We now consider two cases.

If $p\equiv 1\pmod{6}$, then $t(-p)\equiv -t(2p)=-t(2)\pmod{p}$ and
$t(-2p)=t(4)$, so that
\begin{equation}\label{3.5}
t(0)+t(2)+t(4) \equiv 27\bigl(t(0)-t(2)+t(4)\bigr)\pmod{p}.
\end{equation}
Then 
\begin{align*}
a^pG_3(a) &=\sum_{j=0}^5a^{p+j}t(j) 
\equiv t(0)(a-a^2)+t(2)(a^3-a^6)+t(4)(a^5-a^4) \\
&= t(0)-2t(2)+t(4)
=\frac{3}{2}\bigl(t(0)-t(2)+t(4)\bigr)-\frac{1}{2}\bigl(t(0)+t(2)+t(4)\bigr),
\end{align*}
and with (\ref{3.5}) and (\ref{3.4}) we get
\begin{equation}\label{3.6}
a^pG_3(a) \equiv -\frac{4}{9}\bigl(t(0)+t(2)+t(4)\bigr)
\equiv -\frac{2}{9}G_3(-1)\pmod{p}.
\end{equation}
Second, if $p\equiv -1\pmod{6}$, then 
$t(-p)\equiv -t(2p)=-t(-2)=-t(4)\pmod{p}$ and $t(-2p)=t(2)$, so that
\begin{equation}\label{3.7}
t(0)+t(2)+t(4) \equiv 27\bigl(t(0)+t(2)-t(4)\bigr)\pmod{p}.
\end{equation}
Then, as before,
\begin{align*}
a^pG_3(a) &=\sum_{j=0}^5a^{p+j}t(j)
\equiv t(0)(a^5-a^4)+t(2)(a-a^2)+t(4)(a^3-a^0) \\
&= t(0)+t(2)-2t(4)
=\frac{3}{2}\bigl(t(0)+t(2)-t(4)\bigr)-\frac{1}{2}\bigl(t(0)+t(2)+t(4)\bigr),
\end{align*}
and with (\ref{3.7}) and (\ref{3.4}) we get (\ref{3.6}) again. Finally, 
(\ref{3.6}) combined with (\ref{3.2}) gives 
$c_1\equiv -\frac{2}{3}G_3(-1)\pmod{p}$, as required. This completes the 
first proof of Theorem~2.

\vskip 30pt

\section*{\normalsize 4. Sums of Certain Arithmetic Functions Modulo $p$}

Let $f:{\mathbb Z}\rightarrow{\mathbb Z}$ and suppose that there are fixed
integers $c$ and $d$ with $p\nmid d$ such that for all $x,y\in{\mathbb Z}$
we have
\begin{align}
f(x)&\equiv f(y)\pmod{p}\quad\hbox{whenever}\quad x\equiv y\pmod{p},\label{b5}\\
f(-x)&\equiv -f(x)\pmod{p},\label{b6}\\
f(2x)&\equiv cf(x)\pmod{p},\qquad f(6x)\equiv df(x)\pmod{p}.\label{b7}
\end{align}
Then clearly
\begin{equation}\label{b7a}
\sum_{j=1}^{p-1}f(j) \equiv 0 \pmod{p}.
\end{equation}
Furthermore, for each $0\leq r\leq 5$ we set
\begin{equation}\label{b8}
t(r):=\sum_{\substack{j=1\\ j\,\equiv\,r\!\!\!\pmod{6}}}^{p-1}f(j) \quad\hbox{and}\quad
u(r):=\sum_{r\frac{p}{6}<j<(r+1)\frac{p}{6}}f(j).
\end{equation}
For integers $j$ and $r$ as in the sum for $t(r)$ we have $1\leq p-j\leq p-1$
and $p-j\equiv 1-r\pmod{6}$ when $p\equiv 1\pmod{6}$, and 
$p-j\equiv 5-r\pmod{6}$ when $p\equiv 5\pmod{6}$. Therefore we get with
(\ref{b6}),
\begin{equation}\label{b9}
t(r)\equiv\begin{cases}
-t(1-r)\pmod{p} &\hbox{for}\quad 0\leq r\leq 1\quad\hbox{and}\quad p\equiv 1
\pmod{6},\\
-t(7-r)\pmod{p} &\hbox{for}\quad 2\leq r\leq 5\quad\hbox{and}\quad p\equiv 1
\pmod{6},\\
-t(5-r)\pmod{p} &\hbox{for}\quad 0\leq r\leq 5\quad\hbox{and}\quad p\equiv 5
\pmod{6}.
\end{cases}
\end{equation}

We also need congruences connecting the sums $t(r)$, $u(r)$
with each other.

\begin{proposition}
Let $p\geq 5$ be a prime. Then for $p\equiv 1 \pmod{6}$ we have
\begin{equation}\label{b10}
t(r)\equiv\begin{cases}
-du(5)\pmod{p} &\hbox{for}\quad r=0,\\
-du(r-1)\pmod{p} &\hbox{for}\quad 1\leq r\leq 5,
\end{cases}
\end{equation}
while for $p\equiv 5\pmod{6}$ we have
\begin{equation}\label{b11}
t(r)\equiv du(r)\pmod{p},\qquad 0\leq r\leq 5\quad(p\equiv 5\pmod{6}).
\end{equation}
\end{proposition}

\begin{proof}
First, let $p\equiv 1 \pmod{6}$. When $r=0$ we get with (\ref{b8}), and using
successively the congruences (\ref{b7}), (\ref{b6}), and (\ref{b5}),
\begin{align*}
t(0)=&\sum_{j=1}^{\frac{p-1}{6}}f(6j)\equiv d\sum_{j=1}^{\frac{p-1}{6}}f(j)
\equiv -d\sum_{j=1}^{\frac{p-1}{6}}f(-j) \pmod{p} \\
&\equiv -d\sum_{j=1}^{\frac{p-1}{6}}f(p-j)
=-d\sum_{\frac{5p}{6}<j<p}f(j) = -du(5) \pmod{p}.
\end{align*}
Now let $1\leq r\leq 5$. Then we get, using the same congruences as above,
\begin{align*}
t(r)=&\sum_{j=0}^{\frac{p-1}{6}-1}f(r+6j)
\equiv -\sum_{j=0}^{\frac{p-1}{6}-1}f(rp-r-6j) \pmod{p}\\
&\equiv -d\sum_{j=0}^{\frac{p-1}{6}-1}f(r\tfrac{p-1}{6}-j) 
= -d\sum_{(r-1)\frac{p}{6}<j<r\frac{p}{6}}f(j) = -du(r-1) \pmod{p}.
\end{align*}
Now let $p\equiv 5 \pmod{6}$ and $0 \leq r\leq 5$. Using (\ref{b5}) and
(\ref{b7}), as well as the fact that $f(0)\equiv 0\pmod{p}$ by (\ref{b6}),
we get with (\ref{b8}),
\begin{align*}
t(r)=&\sum_{j=0}^{\frac{p+1}{6}-1}f(r+6j)
\equiv \sum_{j=0}^{\frac{p+1}{6}-1}f(r+6j+rp) \pmod{p}\\
&\equiv d\sum_{j=0}^{\frac{p+1}{6}-1}f(j+r\tfrac{p+1}{6})
= d\sum_{r\frac{p}{6}<j<(r+1)\frac{p}{6}}f(j) = du(r) \pmod{p},
\end{align*}
which completes the proof of the proposition.
\end{proof}

Combining (\ref{b10}) and (\ref{b11}) with (\ref{b9}), we obtain the 
following congruence for both cases $p\equiv 1, 5\pmod{6}$; it also
follows directly from the definition of $u(r)$.

\begin{corollary}
For $p\geq 5$ and $0\leq r\leq 5$ we have
\begin{equation}\label{b12}
u(r)\equiv -u(5-r)\pmod{p}.
\end{equation}
\end{corollary}

Next we derive congruences for several other sums involving the 
function $f(j)$.

\begin{proposition}
Let $p\geq 5$ be a prime and suppose that the function 
$f:{\mathbb Z}\rightarrow{\mathbb Z}$ satisfies (\ref{b5}) -- (\ref{b7}). Then
\begin{align}
\sum_{j=1}^{p-1}(-1)^jf(j)&\equiv 2c\sum_{j=1}^{\frac{p-1}{2}}f(j)\pmod{p},
\label{b13} \\
\sum_{\frac{p}{6}<j<\frac{p}{3}}f(j)&\equiv 
\frac{d-c}{2d}\sum_{j=1}^{\frac{p-1}{2}}f(j)\pmod{p}. \label{b14}
\end{align}
\end{proposition}

\begin{proof}
To simplify notation, let $\gamma$ be the left-hand sum in (\ref{b13}) and
$w$ the right-hand sum in both (\ref{b13}) and (\ref{b14}). Furthermore, set
$$
S=\sum_{\substack{j=1\\ j\text{ even}}}^{p-1}f(j),\qquad
L=\sum_{\substack{j=1\\ j\text{ odd}}}^{p-1}f(j).
$$
Then
$$
S=\sum_{j=1}^{\frac{p-1}{2}}f(2j)\equiv c\sum_{j=1}^{\frac{p-1}{2}}f(j)
=cw \pmod{p}.
$$
From (\ref{b7}) we get $L\equiv -S\pmod{p}$; therefore
$\gamma=-L+S\equiv 2S\pmod{p}$, and
\begin{equation}\label{b15}
\gamma \equiv 2cw \pmod{p},
\end{equation}
which gives (\ref{b13}). On the other hand,
$$
\gamma = t(0)+t(2)+t(4)-t(1)-t(3)-t(5),
$$
and by (\ref{b10}) and (\ref{b12}) we get for $p\equiv 1\pmod{6}$,
\begin{align*}
\gamma &\equiv -d\bigl(u(5)+u(1)+u(3)-u(0)-u(2)-u(4)\bigr) \pmod{p}\\
&\equiv -d\bigl(-2u(0)+2u(1)-2u(2)\bigr) = 2d\bigl(w-2u(1)\bigr) \pmod{p}.
\end{align*}
Similarly, with (\ref{b11}) and (\ref{b12}) we get for $p\equiv 5\pmod{6}$,
\begin{align*}
\gamma &\equiv d\bigl(u(0)+u(2)+u(4)-u(1)-u(3)-u(5)\bigr) \pmod{p}\\
&\equiv d\bigl(2u(0)-2u(1)+2u(2)\bigr) = 2d\bigl(w-2u(1)\bigr) \pmod{p}.
\end{align*}
Combining this with (\ref{b15}), we get in both cases,
\begin{equation}\label{b16}
u(1) \equiv \frac{d-c}{2d}w \pmod{p},
\end{equation}
which is the same as (\ref{b14}).
\end{proof}

Finally we derive the following consequence which will be useful later.

\begin{corollary}
Let $p\geq 5$ be a prime, and let $A:=t(0)-t(2)-t(3)+t(5)$, 
$B:=t(1)+t(2)-t(4)-t(5)$, and $w:=\sum_{j=1}^{\frac{p-1}{2}}f(j)$. Then
\begin{gather}
A\equiv -B\equiv \frac{3d-c}{2}w \pmod{p}
\qquad\hbox{for}\quad p\equiv 1\pmod{6},\label{b17}\\
A\equiv 0\pmod{p},\quad B\equiv \frac{3d-c}{2}w \pmod{p}
\qquad\hbox{for}\quad p\equiv 5\pmod{6}.\label{b18}
\end{gather}
\end{corollary}

\begin{proof}
With (\ref{b9}), (\ref{b10}), and (\ref{b12}) we get for $p\equiv 1\pmod{6}$,
\begin{gather*}
A\equiv t(0)-2t(2)-t(3) \equiv d\bigl(u(0)+2u(1)+u(2)\bigr) \pmod{p},\\
B\equiv -t(0)+2t(2)+t(3) \equiv -A \pmod{p},
\end{gather*}
while with (\ref{b9}) and (\ref{b11}) we get for $p\equiv 5\pmod{6}$,
\begin{gather*}
A\equiv 0 \pmod{p},\\
B\equiv t(0)+2t(1)+t(2) \equiv d\bigl(u(0)+2u(1)+u(2)\bigr) \pmod{p}.
\end{gather*}
In both cases (\ref{b16}) is valid, so that
$$
d\bigl(u(0)+2u(1)+u(2)\bigr) \equiv d\bigl(w+\frac{d-c}{2d}w\bigr)
=\frac{3d-c}{2}w \pmod{p},
$$
which completes the proof.
\end{proof}

\vskip 30pt

\section*{\normalsize 5. Second Proof of Theorem~2}

Let $p\geq 5$ be a prime, and let $\mathbb F$ be a field containing 
${\mathbb Z}/p{\mathbb Z}$ such that the polynomial $x^2-x+1=x(x-1)+1$ 
has a root $a$ in $\mathbb F$.
Then $a$ is a primitive 6th root of unity, 
and in $\mathbb F$ we have for each integer $n$, 
\begin{equation}\label{b19a}
a^n = \begin{cases}
a & \hbox{if}\quad n\equiv 1 \pmod{6},\\
-a+1 & \hbox{if}\quad n\equiv 5 \pmod{6}.\\
\end{cases}
\end{equation}
Also, in Section~3 we saw that $q(a)=0$.

The following results deal with values of the sum $G_3(x)$ defined in (\ref{4}).
In analogy to the general sum $w$ in Corollary~2 we denote
$$
W:=\sum_{j=1}^{\frac{p-1}{2}}\frac{1}{j^3}.
$$

\begin{proposition}
For all primes $p\geq 5$ we have in the field $\mathbb F$ 
\begin{equation}\label{b20}
G_3(a)= \begin{cases}
\frac{a-1}{18}W &\hbox{when}\quad p\equiv 1\pmod{6},\\
-\frac{a}{18}W &\hbox{when}\quad p\equiv 5\pmod{6},
\end{cases}
\end{equation}
or equivalently,
\begin{equation}\label{b21}
aG_3(a)= \begin{cases}
-\frac{1}{18}W &\hbox{when}\quad p\equiv 1\pmod{6},\\
-\frac{a-1}{18}W &\hbox{when}\quad p\equiv 5\pmod{6}.
\end{cases}
\end{equation}
\end{proposition}

\begin{proof}
We set $f(x)=x^{p-4}$ for $x\in{\mathbb Z}$. Then 
$f(x)\equiv \frac{1}{x^3}\pmod{p}$ for $p\nmid x$, and $f$ has all the
properties required in Section~4, with $c\equiv\frac{1}{2^3}\pmod{p}$
and $d\equiv\frac{1}{6^3}\pmod{p}$. Using the sums $t(r)$ as defined in 
(\ref{b8}) we get the following identity in $\mathbb F$:
$$
G_3(a)= \sum_{j=1}^{p-1}\frac{a^j}{j^3}
=\bigl(t(0)-t(2)-t(3)+t(5)\bigr)+a\bigl(t(1)+t(2)-t(4)-t(5)\bigr).
$$
The identities in (\ref{b20}) now follow from Corollary~2. Finally,
(\ref{b20}) and (\ref{b21}) are equivalent since in $\mathbb F$ we have 
$a(a-1)=-1$.
\end{proof}

We are now ready to determine the constant $c_1$ in (\ref{14a}).

\begin{proposition}
For primes $p\geq 5$ we have
\begin{equation}\label{b21a}
c_1 \equiv -\frac{1}{6} \sum_{j=1}^{\frac{p-1}{2}}\frac{1}{j^3} \pmod{p}.
\end{equation}
\end{proposition}

\begin{proof}
We consider (\ref{14a}) as a polynomial identity in $\mathbb F$ and evaluate
the various members for $x=a$. Since $q(a)=0$, the
left-hand side is 0. Next, by (\ref{b20}) and (\ref{b19a}) we get
$$
a^pG_3(a)= \begin{cases}
a\frac{a-1}{18}W=\frac{a-1-a}{18}W &\hbox{when}\quad p\equiv 1\pmod{6},\\
-(-a+1)\frac{a}{18}W=\frac{a-1-a}{18}W &\hbox{when}\quad p\equiv 5\pmod{6},
\end{cases}
$$
and thus
\begin{equation}\label{b22}
a^pG_3(a)= -\frac{1}{18}W. 
\end{equation}
Now we consider the congruence (\ref{15}) as a polynomial identity in 
$\mathbb F$ and obtain, since $\frac{1}{a}=1-a$,
$$
G_3(1-a) = G_3(\tfrac{1}{a}) = -\frac{1}{a^p}G_3(a).
$$
Using (\ref{b21}) and (\ref{b19a}) we get
\begin{equation}\label{b23}
G_3(1-a)= \begin{cases}
-\frac{a}{18}W &\hbox{when}\quad p\equiv 1\pmod{6},\\
\frac{a-1}{18}W &\hbox{when}\quad p\equiv 5\pmod{6}.
\end{cases}
\end{equation}
Since $1-\frac{1}{a}=\frac{a-1}{a}=a$ we have, again with (\ref{b20}),
\begin{equation}\label{b24}
G_3(1-\tfrac{1}{a})= \begin{cases}
\frac{a-1}{18}W &\hbox{when}\quad p\equiv 1\pmod{6},\\
-\frac{a}{18}W &\hbox{when}\quad p\equiv 5\pmod{6}.
\end{cases}
\end{equation}
If we note that, by (\ref{b19a}), $a^p(1-a^p)=1$ for all primes $p\geq 5$, and
$$
1-a^p=\begin{cases}
1-a, \\
a, 
\end{cases} \qquad
a^{2p}(1-a^p)=\begin{cases}
a &\hbox{for}\quad p\equiv 1\pmod{6},\\
-a+1 &\hbox{for}\quad p\equiv 5\pmod{6},
\end{cases}
$$
then with (\ref{b22}) -- (\ref{b24}) the right-hand side of (\ref{14a}) 
with $x=a$ becomes
$$
\begin{cases}
\frac{W}{18}\bigl(1-(1-a)(-a)-a(a-1)\bigr)+c_1 
&\hbox{for}\quad p\equiv 1\pmod{6},\\
\frac{W}{18}\bigl(1-a(a-1)-(-a+1)(-a)\bigr)+c_1
&\hbox{for}\quad p\equiv 5\pmod{6}.
\end{cases}
$$
Since $a(a-1)=-1$ and $q(a)=0$, we get in both cases
$c_1=-\frac{1}{6}W$,
which completes the proof of (\ref{b21a}).
\end{proof}

\begin{proposition}
For primes $p\geq 3$ we have
\begin{equation}\label{b25}
4G_3(-1) \equiv \sum_{j=1}^{\frac{p-1}{2}}\frac{1}{j^3} \pmod{p}.
\end{equation}
\end{proposition}

\begin{proof}
For $p\geq 5$ let $f$ be the function defined in the proof of Proposition~3. 
Then 
(\ref{b13}) gives
$$
G_3(-1)=\sum_{j=1}^{p-1}\frac{(-1)^j}{j^3}
\equiv \sum_{j=1}^{p-1}(-1)^jf(j)
\equiv \frac{1}{4}\sum_{j=1}^{\frac{p-1}{2}}f(j) \pmod{p},
$$
which is the same as (\ref{b25}). The case $p=3$ can be verified directly.
\end{proof}

It is now obvious that (\ref{14a}) combined with (\ref{b21a}) and (\ref{b25})
completes the proof of Theorem~2.
The congruence (\ref{b25}) also shows that (\ref{1d}) and (\ref{1e}) are
equivalent.

\vskip 30pt

\section*{\normalsize Acknowledgments}

Research on this paper was begun while the first author visited Masaryk
University in Brno, partly supported by 
the Grant Agency of the Czech Republic. He wishes to thank
the Department of Mathematics and Professor Radan Ku\v{c}era for their
hospitality.

\begin{thebibliography}{5} \footnotesize

\bibitem{Gl} J.~W.~L.~Glaisher, {\it On the residues of the sums of products
of the first $p-1$ numbers and their powers to modulus $p^2$ or $p^3$\/},
Quart. J. Math. Oxford {\bf 31} (1900), 321--353.

\bibitem{Gr} A.~Granville, {\it The square of the Fermat quotient\/},
Integers: Electronic J. of Combinatorial Number Theory {\bf 4} (2004), 
\#A22 (electronic).

\bibitem{Ri} P.~Ribenboim, {\it 13 Lectures on Fermat's Last Theorem\/}.
Springer-Verlag, New York, 1979.

\end{thebibliography}

\end{document}
 
