Understanding a proof of the sum group of integers modulo $n$ I was trying to practice some questions in Groups and especially about the $\mathbb{Z}_{41}$ (the Sum group of integers modulo $n$). I came across with the following question:

What is the order of $3\in\mathbb{Z}_{41}$?

I know the hard way to solve it by finding the minimal $n\in\mathbb{N}$ so $3^n=1$ but I saw another proof:

$3^4=81=81-2\cdot 41=-1$
we know that $o(-1)=2$ so $3^8=(3^4)^2=(-1)^2=1$
We get $o(3)=8$

I don't understand why $81=81-2\cdot 41$ and why does it work.
I understand that $3^4=81\,(mod\,41)=40$ though.
Is it true to say that $x-41=x$ (in that way we get $40-41=40$ so $-1=40$).
 A: You thinking as a group $(\Bbb Z_n,.)$. This is not true. If you think  $(\Bbb Z_n,+)$ as a group you can solve this question.
The order of $3\in Z_{41}$ is the minimal $n$ such that $3n\equiv 1 \mod 41$
If you consider $41$ is prime, so $Z_{41}^{\star}$ is a multiplicative group, then you can evaluate the order of $3$ as above.

we know $o(-1)=2$. So we are searching  $n$ to compute the order of $3$ such that $3^{n}=-1=40\mod 41 $. Anyway, It is not a general method. He stops to compute of $3^n$ when catch to $-1$.
A: That proof only works for $n = 41$ (or $n = 2$, or $n = 82$), where $n$ is the first think you've called by that name, not the second. For other $n$, the result as shown is simply untrue (for example, $3$ has order $2$ in $\mathbb{Z}_5$).
A: In $\,\Bbb Z_{\large\color{#c00}{41}}$ we have $\, \color{#c00}{41= 0}\ $ so $\ 81 = 2\cdot \color{#c00}{41}-1 = 2\cdot\color{#c00}0-1 = -1$
Squaring $\,3^{\large 4}\! = 81 = -1\Rightarrow 3^{\large 8}\! = (-1)^{\large 2}\!= 1\,$ so $\,3\,$ has order $k$ dividing $\,8 = 2^{\large 3}.\,$ But $\,k\nmid 4 = 2^{\large 2}\,$ else $\, -1 = 3^{\large 4}\! = (3^{\large k})^{\large 4/k}\! = 1^{\large 4/k}\! = 1\,$ contradiction.  Thus $\,k = 8,\,$ i.e. $\,3\,$ has order $\,8$.
Remark $ $ Generally if $\,p\,$ is prime and $\,a^{\large p^{\Large k}}\!\! = 1\, $ but $\,a^{\large p^{\Large k-1}}\!\!\neq 1$ then $\,a\,$ has order $\,p^k\,$ by below.
Order Test $\ \ \ \,a\,$ has order $\,n\ \iff\  a^{\large n} = 1\ $ but $\ \color{#0a0}{a^{\large n/p} \neq 1}\,$ for every prime $\,p\mid n$ 
Proof $\,\ (\Leftarrow)\,\ $ Let $\,a\,$ have $\,\color{#c00}{{\rm order}\ k}.\,$ Then $\,k\mid n\,$ (proof). $ $  If $\:k < n\,$ then $\,k\,$ is proper divisor of $\,n\,$ so by unique factorization $\,k\,$ arises by deleting at least one prime $\,p\,$ from the prime factorization of $\,n,\,$ so $\,k\mid n/p,\,$ say $\, kj = n/p,\ $ so $\ \color{#0a0}{a^{\large n/p}} = (\color{#c00}{a^{\large k}})^{\large j} = \color{#c00}1^{\large j} = \color{#0a0}1\,$ contra $\rm\color{#0a0}{hypothesis}$. So $\,k=n.$ $\, (\Rightarrow)\ $ Clear
