I'm searching for a reasonable definition of a distance function $$d:\mathbb{Z}/n\mathbb{Z}\times \mathbb{Z}/n\mathbb{Z}\to\mathbb{N}_0$$ which satisfies
- $d(\overline{n-1},0)=1$
- $d(\overline{i},\overline{j})=j-i$ for all $0\le i<j<n$
How should I define $d$?
You could define the magnitude of a number as $$|x|:=\min\{x\bmod n,-x\bmod n\}$$
which gives essentially distance from $0\equiv n$.
Then the distance would just be $$d(i,j)=|i-j|$$ Is that what you are looking for?