  Collisionless shocks are often studied in two spatial dimensions (2D), to
gain insights into the 3D case. We analyze diffusive shock acceleration for an
arbitrary number $N\in\mathbb{N}$ of dimensions. For a non-relativistic shock
of compression ratio $\mathcal{R}$, the spectral index of the accelerated
particles is $s_E=1+N/(\mathcal{R}-1)$; this curiously yields, for any $N$, the
familiar $s_E=2$ (i.e., equal energy per logarithmic particle energy bin) for a
strong shock in a mono-atomic gas. A precise relation between $s_E$ and the
anisotropy along an arbitrary relativistic shock is derived, and is used to
obtain an analytic expression for $s_E$ in the case of isotropic angular
diffusion, affirming an analogous result in 3D. In particular, this approach
yields $s_E = (1+\sqrt{13})/2 \simeq 2.30$ in the ultra-relativistic shock
limit for $N=2$, and $s_E(N\to\infty)=2$ for any strong shock. The angular
eigenfunctions of the isotropic-diffusion transport equation reduce in 2D to
elliptic cosine functions, providing a rigorous solution to the problem; the
first function upstream already yields a remarkably accurate approximation. We
show how these and additional results can be used to promote the study of
shocks in 3D.
