A couple of recent questions on MO have involved the characters or the orders of specific finite groups of the form $G(\mathbb{Z}/n\mathbb{Z})$ for a familiar algebraic group $G$ defined over $\mathbb{Z}$ (implicitly as a group scheme) especially when $n$ is a prime power: [here](https://mathoverflow.net/questions/87254/) and
[here](https://mathoverflow.net/questions/87904/).


It's reasonable to ask in what generality questions of the second kind can be treated uniformly. Here for example the question doesn't seem to require any knowledge of the structure of symplectic matrices, once one knows the orders of the finite symplectic groups over fields. (These have been written down in numerous papers and books.) In particular:



> 
> For group schemes $G$ over $\mathbb{Z}$, in what natural generality is there a uniform procedure for computation of the orders of finite groups $G(\mathbb{Z}/p^k\mathbb{Z})$ as $p$ ranges over the prime numbrs?
> 
> 
> 


An old computation having a similar flavor occurs for the multiplicative group scheme (which is reductive but not simple) in the determination of the group of units in the ring $\mathbb{Z}\_p$ of $p$-adic integers, written as an inverse limit of finite groups with successive quotients of order $p-1$ or $p$. Here the additive group scheme (viewed as the Lie algebra of the multiplicative group scheme) enters the picture, providing an iterated extension of the group of units of the residue field $\mathbb{F}\_p$. See for example the book by Serre *A Course in Arithmetic*, II, section 3.


As George McNinch points out in his comment on Scott Carnahan's direct computation of the order for finite symplectic groups, a uniform approach is suggested by a paper of Serre, "Exemples de plongements des groupes PSL$\_2(\mathbb{F}\_p)$ dans des groupes de Lie simples", *Invent. Math.* 124 (1996), 3.1. Here *G* is a connected simple algebraic group over an algebraically closed field, essentially treated as a group scheme. Serre refers in turn to Demazure-Gabriel, *Groupes Algebriques* (1970), II, section 4, no. 3, a treatise influenced by the earlier Demazure-Grothendieck seminar SGA3. 


In a Bourbaki talk, Chevalley showed how to view the simple adjoint groups, which he had constructed in a uniform way in 1955, as group schemes over $\mathbb{Z}$, a theme refined further by Kostant, and more recently by Lusztig in *J. Amer. Math. Soc.* 22 (2009). That seems to be a good setting for the question I've raised, though perhaps one can go further in the direction of reductive groups?


ADDED: The answers and comments are very interesting, but while I think further about them and the literature I should clarify that I'm taking for granted the standard (though nontrivial) formulas for the group orders over finite fields. And while it's natural (at least for Chevalley groups) to start over the ring of integers, there is certainly a passage to local rings implied here. The specific prime stays in the background, since unlike many questions in Lie theory this kind of computation doesn't distinguish "good" and "bad" primes: whatever is done should apply uniformly to all primes. Meanwhile a result in Appendix A.5 of the recent book by Conrad-Gabber-Prasad on pseudo-reductive groups has been pointed out to me. This suggests that groups aren't so essential to my question, but only a well-behaved class of schemes (again assuming that one can already count their points over finite fields). 



Uniform setting for computing orders of algebraic groups over finite quotients of the integers?
I think the assumptions needed on a group scheme $G$ over $\mathbf{Z}$ are that $G$
should be smooth, affine, and of finite type over $\mathbf{Z}$. Actually,
I'm going to take the point of view that $p$ is fixed and so I'll suppose that $G$ is smooth, affine, and of finite type over the local ring $\mathbf{Z}\_{(p)}$.


I'm going to write $\Lambda = \Lambda\_r = \mathbf{Z}/p^r\mathbf{Z}$ and $F = \mathbf{F}\_p = \Lambda/p\Lambda$.


To give a formula for $|G(\Lambda)|$, you should have a formula for the number of points of the special fiber -- i.e. for $|G(\mathbf{F}\_p)|$ (which is OK e.g. if the special fiber is reductive by well-known order formulas as mentioned in Marty's answer).


Let $H$ be an affine group scheme over $\Lambda$ (say, arising by base-change from 
the group scheme $G$ over $\mathbf{Z}\_{(p)}$).


The result in Demazure-Gabriel to which Serre refers in the article "Exemples de plongements..." (as discussed in the question) implies that the kernel $I$
of the natural mapping $H(\Lambda\_k) \to H(\Lambda\_{r-1})$
identifies naturally with the $F$-vector space 


$$Hom\_{\Lambda}(\omega\_{H/\Lambda},p^{r-1}\Lambda)$$ 


where $\omega\_{H/\Lambda}$ is the module of Kahler differentials of $H$ over $\Lambda$.


In particular, $|I| = p^d$ where $d = \dim\_F (\omega\_{H/\Lambda} \otimes\_{\Lambda} F)$.


If $H$ is smooth and of finite type over $\Lambda$ (e.g. if $H = G\_{/\Lambda}$ for
$G$ smooth over $\mathbf{Z}\_{(p)}$) then the natural mapping
$H(\Lambda\_r) \to H(\Lambda\_{r-1})$ is surjective (say, by [SGA1, Corr. III.5.3])
and $\omega\_{H/\Lambda}$ is a free $\Lambda$-module of rank $\dim H\_{/F}$.
And in this case, one gets the formula for $|H(\Lambda)|$ given in Stasinski's answer.


And if $H = G\_{/\Lambda}$ then of course $H(\Lambda) = G(\Lambda)$.


Remarks:
(1) It seems to me (?) that the result just quoted from Demazure-Gabriel answers
the conjecture from the end of Greenberg's 1963 paper mentioned in Stasinski's answer.


(2) Let $k$ be (say) an algebraically closed field, and let $W = W\_r$ be the
ring of Witt vectors of length $r$ over $k$. Then our smooth group scheme $G$ as before determines a group scheme
$H = G\_{/W}$ over $W$. By "Greenberg's functor" we can view the group
of points $G(W) = H(W)$ as a linear algebraic group over $k$. 


If say $r=2$, then there is a strictly exact sequence of linear algebraic groups
$$ (\*) \quad 0 \to V \to H(W) \to G\_{/k} \to 1$$
where $V = $ Lie$(G\_{/k})^{[1]}$ is the vector group on which $G\_{/k}$ acts via the *first Frobenius twist* of the adjoint representation Lie$(G\_{/k})$.


I mention this because one somehow doesn't "see" the Frobenius twist when the residue
field is $\mathbf{F}\_p$, but the Frobenius twist
is important in general.


Indeed, if say $G\_{/k}$ is a simple alegbraic group, the exact sequence $(\*)$ is not split -- it corresonds
to a non-zero class in $H^2(G\_{/k},$Lie$(G\_{/k})^{[1]})$.
So the Frobenius
twist is crucial since most of the time $H^2(G\_{/k},$Lie$(G\_{/k})) = 0$.


