  Previous works indicate that the frequency ratio of second and first
harmonics of kink oscillations has tendency towards 3 in the case of prominence
threads. We aim to study the magnetohydrodynamic oscillations of longitudinally
inhomogeneous prominence threads and to shed light on the problem of frequency
ratio. Classical Sturm--Liouville problem is used for the threads with
longitudinally inhomogeneous plasma density. We show that the spatial variation
of total pressure perturbations along the thread is governed by the stationary
Schr\"{o}dinger equation, where the longitudinal inhomogeneity of plasma
density stands for the potential energy. Consequently, the equation has bounded
solutions in terms of Hermite polynomials. Boundary conditions at the thread
surface lead to transcendental dispersion equation with Bessel functions. Thin
flux tube approximation of the dispersion equation shows that the frequency of
kink waves is proportional to the expression \alpha(2n+1), where \alpha is the
density inhomogeneity parameter and n is the longitudinal mode number.
Consequently, the ratio of the frequencies of second and first harmonics tends
to 3 in prominence threads. Numerical solution of the dispersion equation shows
that the ratio only slightly decreases for thicker tubes in the case of smaller
longitudinal inhomogeneity of external density, therefore the thin flux tube
limit is a good approximation for prominence oscillations. However, stronger
longitudinal inhomogeneity of external density may lead to the significant
shift of frequency ratio for wider tubes and therefore the thin tube
approximation may fail. The tendency of frequency ratio of second and first
harmonics towards 3 in prominence threads is explained by the analogy of the
oscillations with quantum harmonic oscillator, where the density inhomogeneity
of the threads plays a role of potential energy.
