In 1987, Weidmann proved that, for a symmetric differential operator τ and a real λ, if there exist fewer square-integrable solutions of (τ−λ)y = 0 than needed and if there is a self-adjoint extension of τ such that λ is not its eigenvalue, then λ belongs to the essential spectrum of τ. However, he posed an open problem of whether the second condition is necessary and it has been conjectured that the second condition can be removed. In this paper, we first set up a formula of the dimensions of null spaces for a closed symmetric operator and its closed symmetric extension at a point outside the essential spectrum. We then establish a formula of the numbers of linearly independent square-integrable solutions on the left and the right subintervals, and on the entire interval for nth-order differential operators. The latter formula ascertains the above conjecture. These results are crucial in criteria of essential spectra in terms of the numbers of square-integrable solutions for real values of the spectral parameter.