as far as I can see, Lagrange says:
IF
$p$ = prime, $p-1 = 2*q$, $q$ = prime
THEN
$g^q \mod p = 1 \implies \text{order}(g) = q$
$g^q \mod p \neq 1 \implies \text{order}(g) = p-1$
However if i try to calculate the order of $6 \mod 7$:
$p = 7 \implies p-1 = 6 = 2 \cdot 3 \implies q=3$, $6^3 \mod 7 = 6 \neq 1 \implies \text{order}(6)$ should be $6$.
But doing it by hand i get the following:
$6^1 \mod 7 = 6$
$6^2 \mod 7 = 1$
$6^3 \mod 7 = 6$
$6^4 \mod 7 = 1$
...
so order should be $2$ instead of $6$ right? What am I missing, i really don't get it :(