Why is that for $x = \frac{\sum_{n=1}^{(p-1)} n}{p}$, where $p$ is a prime number, $x$ is always a positive integer?

35 Views Asked by At

Here is a graph for the first few primes vs sum. prime vs sum

2

There are 2 best solutions below

1
On

$$\sum_{n=1}^{p-1}n=1+2+3+...+(p-1)=\frac{p(p-1)}{2}$$

thus, your sum will become $$x=\frac{p-1}{2}=\frac{\phi(p)}{2}$$

where $n \mapsto \phi(n) $ is the Euler totient function.

0
On

$\sum_{n=1}^{p-1} = \frac{(p-1)p}{2}$ which has a factor of $p$ for any $p>2$.