I have this question for homework that I cannot solve.
For $n\ge5$ prime number, calculate $1+\frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{(n-1)^2}$ in $\mathbb{Z}_n$.
I tried proving it using induction but I can't get a good answer for $n=5$. I also tried showing that the sum of the series above is equal to the sum of squares of the members of $\mathbb{Z}_5$.
First rewrite the sum as $$ 1+\frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{(n-1)^2} = (\frac{1}{1})^2 + (\frac{1}{2})^2 + (\frac{1}{2})^2 + \cdots + (\frac{1}{n-1})^2 $$
Then note that the list of numbers you square, $$ \frac{1}{1}, \frac{1}{2}, \frac{1}{3}, \ldots, \frac{1}{n-1} $$ is just the list $1, 2, 3, \ldots, n-1$ in a different order. It must be so, because $x\mapsto \frac1x$ is a bijection from the set of nonzero elements in the field to itself. Since "$1,2,3,\ldots$" contains each of these elements once, their reciprocals must also contain each element exactly once.
Now, since addition is commutative, you can sum $$ 1^2 + 2^2 + 3^2 + \cdots + (n-1)^2 $$ using the standard formula for sums of squares in the ordinary integers, and then reduce the result modulo $n$.