Solution (source code)

= Solution

Use periodic boundaries in a box of side $L$ and include two <Spin degeneracy>[spin states] for each <wavevector>. One orbital state occupies $(2\pi/L)^d$ in <wavevector> space. Let $v_d$ be the volume of the unit ball in dimension $d$, namely $2,\pi,4\pi/3$. Filling the ball of radius $k_F$ gives
$$
N=2\left(\frac{L}{2\pi}\right)^d v_dk_F^d,
\qquad k_F^d=\frac{(2\pi)^d}{2v_d}n.
$$
Since $E_F=\hbar^2k_F^2/(2m)$,
$$
\boxed{a_d=\frac{(2\pi)^d}{2v_d},\qquad
 a_1=\frac\pi2,\quad a_2=2\pi,\quad a_3=3\pi^2.}
$$
The density $n$ means number per length, area or volume as appropriate; it is not assigned three-dimensional units in every case.

For the same spin-summed states, the cumulative number per $d$-dimensional volume below <energy> $E$ is $n(E)=2v_d(2mE/\hbar^2)^{d/2}/(2\pi)^d$. <Derivative>[Differentiating] yields $g(E)=(d/2)n(E)/E$. Evaluating at the filling <energy>,
$$
\boxed{g(E_F)=b_d\frac n{E_F},\qquad
b_1=\frac12,\quad b_2=1,\quad b_3=\frac32.}
$$
In one, two and three dimensions the <density of states> varies respectively as $E^{-1/2}$, a constant and $E^{1/2}$. The normalization counts both signs of <momentum> and both <Spin degeneracy>[spin states] exactly once. A single-spin <density of states> or extra valley degeneracy would require a different counting convention, not an extra unexplained factor in these constants.