Analytical expressions for the eigenvalues of anharmonic oscillators