# boundary conditions in QM and statistical physics

I don't understand something about boundary conditions in problem that I discuss it below. in QM we solve the particle in Potential well and we obtain that we should have $$k=\frac{n*pi}L$$ that $$n\in{N}$$(because negative n don't give new wave function) in statistical physics if we count number of microstates we put 1/8 to count only positive n.but we have another problem say free particle in box of volume V . then the wave function is $$(\frac{e^{i\vec k.\vec x}}{\sqrt V})$$ and in many books and lectures says Boundary conditions require that the wavevector $$\vec k$$ should be quantized as $$\vec k=\frac{2pi*\vec n}{L}$$ and $$n\in Z$$! and after it calculate the for example Density of States and every things we want in statistical physics.and don't put 1/8 behind their equation!so my problem is what is different between this 2 case that in first $$n\in N$$ and second $$n\in Z$$ (but with 2 added to its equation) and then 2 cases give the same physics.is there 2 independent problem or one problem with 2 different of viewpoint?