Solution (source code)

= Solution

For an infinite cubic <potential well> of side $L$, the one-particle <energy eigenvalues> are $E_{n_xn_yn_z}=E_0(n_x^2+n_y^2+n_z^2)$, where $E_0=\pi^2\hbar^2/(2mL^2)$ and each quantum number is a positive integer. The lowest spatial orbital is $(1,1,1)$, with <energy> $3E_0$ and orbital degeneracy one. The next <energy> is $6E_0$, with three orbitals given by permutations of $(2,1,1)$.

Spin-zero identical particles are <bosons>. Both can occupy the lowest orbital, so \b[the two-boson <ground state> is nondegenerate]. The first excited total <energy> is $9E_0$: one particle occupies the lowest orbital and one an excited orbital. Symmetrizing the two-particle <wavefunction> gives one state for each of the three excited orbitals, so \b[the first-excited degeneracy is three].

Spin-half identical particles are <fermions>, so the total state must be antisymmetric. Two particles in the same lowest orbital have a symmetric spatial <wavefunction> and must form the unique <spin singlet state>. Thus \b[the <fermion> <ground state> is also nondegenerate]. At the first excited <energy>, each choice of excited spatial orbital permits a symmetric spatial state with a <singlet state>, or an antisymmetric spatial state with a three-dimensional <triplet state>. Therefore
$$
\boxed{g_{\rm ground}=1,\qquad g_{\rm first}=3(1+3)=12\quad\text{for spin }\tfrac12.}
$$
The spin multiplicity is essential: counting only the three orbital choices would omit allowed triplet states. The result assumes ordinary spin-statistics, an unsplit spin degeneracy and the hard-wall cube model.