In a one dimensional "box" of length L, the "allowed" wavelengths are corresponding to wavenumbers . Thus the smallest posssible wavenumber, and the "distance" (in k-space) between successive allowed wavenumbers, is . There is allowed "state" per . Put another way, the "density" of allowed states per unit wavenumber is or, for this one-dimensional (1D) case, .
Note that n > 0 k > 0. We are drawing standing waves, (we choose x=0 at the centre of the box, for symmetry), for which "negative" k values have no independent meaning.