# A number theoretic identity

Let $n$ be a positive integer such that $2n+1$ is prime. The elements of the factor group $G = \mathbb{F}^\times_{2n+1}/\{\pm 1\}$ can be represented by the integers $1,2,\ldots,n$. For every $x \in \mathbb{F}^\times_{2n+1}$, let $x' \in \{1,2,\ldots,n\}$ denote the representative of its image in $G$. For every $\lambda \in\{2,\ldots,n-1\}$, let

$$S_\lambda = \sum_{a=1}^n |a-(a\lambda)'|,$$

where $|\cdot|$ denotes the usual absolute value. For example, when $n=6$, and $\lambda=3$, $$S_3 = |1-3| + |2-6| + |3-4| + |4-1| + |5-2| + |6-5| = 14.$$

Is it true that $S_\lambda = n(n+1)/3$, for every $\lambda \geq 2$?

-
Where does this problem come from? It was mentioned in mathlinks.ro/viewtopic.php?t=125645 , and hipsishopsis has posted a proof. Haven't checked it, however. –  darij grinberg Mar 3 '10 at 15:01
This question appears to be off-topic because it is about an unmotivated problem that comes from and is solved elsewhere. –  quid Nov 9 '14 at 13:24
The link given by darij grinberg to a possible proof by hipsishopsis no longer works. The question doesn't look bad to me. –  Lucia Nov 9 '14 at 15:19
Do those who voted to close see an easy proof of this? It seems a remarkable fact to me (if true), but maybe I'm missing something obvious. The objection that the problem is unmotivated doesn't seem correct to me: if the numbers from $1$ to $m$ are permuted randomly without fixed points, the expected value of $|a-\sigma(a)|$ would be the answer given. It's not at all clear to me why multiplication by $\lambda$ should always give exactly this answer. –  Lucia Nov 10 '14 at 5:32
I agree with @Lucia and I voted to reopen. –  Gjergji Zaimi Nov 10 '14 at 7:52