I would like to know the cohomology groups $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$. I assume that this is a standard computation, but I'm not sure where to look up the answer (and, not being a great algebraic topologist, I'm not sure how to do the computation myself).


Note that by induction $\mathrm B^{n-1}(\mathbb Z/2)$ is an $E\_\infty$ group, so $\mathrm B^n(\mathbb Z/2) = \mathrm B(\mathrm B^{n-1}(\mathbb Z/2))$ exists, and is an $E\_\infty$ group. Thus $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$ is a Hopf algebra. By Hurewicz theorem, it begins (in dimensions) $1, 0,\dots,0,1,\dots$, where the first cohomology class occurs in degree $n$. I assume that the whole $\mathrm H^\bullet(\mathrm B^n(\mathbb Z/2);\mathbb Z/2)$ is $(\mathbb Z/2)[x]$ where $x$ has cohomological degree $n$, so that $B^n(\mathbb Z/2)$ has cohomology precisely in the multiples of $n$. The latter statement is true for $n=0$ (although the description qua polynomial algebra needs modification), and my whole assumption does hold when $n=1$.


Note also that $B^n(\mathbb Z/2)$ classifies $\mathrm H^n(-;\mathbb Z/2)$, so I'm equivalently asking:



> 
> What is the set $\pi\_0\mathrm{maps}(B^n(\mathbb Z/2),B^m(\mathbb Z/2))$?
> 
> 
> 



What is the $\mathbb Z/2$-cohomology of $\mathrm B^n(\mathbb Z/2)$?
All cohomology in this answer will have $\mathbb{Z}/2$ coefficients, and $K\_n$ will denote $B^n(\mathbb{Z}/2)$. By the Yoneda lemma, the cohomology $H^m(K\_n)$ can also be thought of as the natural operations that take a cohomology class in degree $n$ on a space and give a cohomology class in degree $m$. As you note, the identity gives a canonical element $\iota\_n\in H^n(K\_n)$, and cup powers give further classes $\iota\_n^k\in H^{nk}(K\_n)$. However, it is not true for $n>1$ that $H^\*(K\_n)$ is $\mathbb{Z}/2[\iota\_n]$: there are other operations as well, namely [Steenrod squares](https://en.wikipedia.org/wiki/Steenrod_algebra). It turns out that all of $H^\*(K\_n)$ is generated by $\iota\_n$ under Steenrod squares and cup products, and that it is freely generated in the sense that it is initial among graded commutative $\mathbb{Z}/2$-algebras containing a class $\iota\_n$ in degree $n$ with an action of Steenrod squares that satisfies certain relations (specifically, [these relations](https://en.wikipedia.org/wiki/Steenrod_algebra#Axiomatic_characterization) describing how Steenrod squares interact with the grading and the ring structure and [these relations](https://en.wikipedia.org/wiki/Steenrod_algebra#Adem_relations) regarding the composition of Steenrod squares). As a commutative $\mathbb{Z}/2$-algebra, it turns out that $H^\*(K\_n)$ is a polynomial ring on the expressions of the form $Sq^{k\_1}\dots Sq^{k\_m}\iota\_n$ such that $k\_i\geq 2k\_{i+1}$ for each $i$ and $\sum k\_i-2k\_{i+1}<n$ (where $k\_{m+1}$ is taken to be $0$). In particular, for $n>1$, there are infinitely many such expressions, so $H^\*(K\_n)$ is a rather large ring. Finally, the Hopf algebra structure is very easy to compute: the $H$-space structure map $K\_n\times K\_n\to K\_n$ represents addition of cohomology classes and the Steenrod squares are linear, and so all of the polynomial generators are primitive.


This computation of $H^\*(K\_n)$ can be done by induction on $n$ using the Serre spectral sequence and the fact that the Steenrod squares commute with the transgression map of the Serre spectral sequence (in fact, I believe this was one of Serre's original applications of the spectral sequence). A nice reference for all of this is Mosher and Tangora's little book *Cohomology Operations and Applications in Homotopy Theory*. If you want more references, some good terms to google are "cohomology of Eilenberg-Mac Lane spaces", "Steenrod algebra", and "admissible sequence".


