Cardinal of the Special Orthogonal Group $SO_n\left(\mathbb{Z}/2^n\mathbb{Z}\right)$ Let $SO_n(R)$ be the group of matrices with coefficients in a ring $R$ whose determinant is equal to $1$.
I remembered an old question asked at an oral exam :
$$\text{What is the order of the group }SO_n(\mathbb{Z}/2^n\mathbb{Z}) \ ?$$
Is there a way to count them ? I don't see a way to solve this question
 A: Let us count the cardinality $c_n(m) $ of $C_n(m):= SO_m(\mathbb{Z}/2^n\mathbb{Z}) $ by induction on $m$. The base case is easy, since evidently $c_n(1) = 1$. Now consider the action of $C_n(m)$ on  $(\mathbb{Z}/2^n\mathbb{Z}) ^m$ for $m\ge 2$.
The key observation is that the stabilizer of $e_1$ is precisely $C_n(m-1) $. Indeed, you have an orthogonal matrix with first column $(1 \ 0 \ldots \ 0) $, so all the other columns must start with zero and the determinant of the $(m-1) \times (m-1) $ matrix left in the bottom-right must be one.
The orbit of $e_1$ under $SO_m$ are all the vectors
$$(x_1, \ldots, x_m) \in (\mathbb{Z}/2^n\mathbb{Z}) ^m \ : x_1^2+ \ldots + x_m^2 = 1 $$
but up to a square root of 1 in $\mathbb{Z}/2^n\mathbb{Z}$. Let us denote this set by $X_2(n)$. Indeed, $O_m(\mathbb{Z}/2^n \mathbb{Z}) = SO_m(\mathbb{Z}/2^n \mathbb{Z}) \cdot X_2(n) $, so that the orbit under $O_m$ will be the orbit under $SO_m$ times the orbit under scalar multiplication of $X_2(n) $. I don't have any effective ideas at the moment to compute $O_n(\mathbb{Z}/2^n\mathbb{Z}) e_1$, so let's call it $K_{n, m}$. The other involved quantity - $X_2(n) $, is easy to compute: recall that the multiplicative group of $ \mathbb{Z}/2^n \mathbb{Z}$ is isomorphic to $\mathbb{Z}/2\mathbb{Z} \times (\mathbb{Z}/2\mathbb{Z}) ^{n-2} $ for $n\ge 2$, so that the elements of order 2 are 4 if $n\ge 3$, and $n$ if $n\le 2$.
Since the orbit and the stabilizer have product equal to the cardinality of the group, we have that
$$ c_n(m) = c_n(m-1) \cdot K_{n, m} /x_2(n) $$
This implies that
$$ c_n(m) =\left (  \prod_{r=2}^m K_{n, r} \right ) / (x_2(n) ) ^{m-1}$$
A special case. In the case of $n=1$ the sphere equation is particularly simple, as it would be in any field of characteristics 2. Indeed the square commutes with the sum and we have
$$ (x_1+\ldots+x_m) ^2 = 1$$
which implies that the sum must be an element of $X_2(1) =\{1\}$. If you choose the first $m-1$ elements as you wish in 0,1, you can choose in the right way $x_m$ in a unique way so that the equation holds true. This shows that $K_{n, m}= 2^{m-1} x_2(1) $, so that
$$ c_1(m) =  \prod_{r=2}^m K_{1, r} / (x_2(1) ) ^{m-1} = \prod_{r=2}^m 2^{r-1} = \boxed{ 2^{\binom{m}{2} }}$$
Edit. The last observation makes me suspect that the original question was in the field of characteristics 2 $F_{2^n}$, for which the last result hold but with exponent $n\binom{m}{2} $ (the argument is pretty the same!).
