Almost tight asymptotic enumeration of finite $p$-groups: Almost all finite groups are $2$-groups of class $2$
Let $f(n)$ denote the number of isomorphism classes of groups of order $n$. We prove, uniformly over all primes $p$, that \[ \log_p f(p^m)=\frac{2}{27}m^3-\frac49m^2+O(m), \] with an absolute implied constant. This improves the classical upper bounds of Sims (\emph{Proc. Lond. Math. Soc.}, 1965) and Newman--Seeley and...