Theoretical study of electronic structure of erbium and fermium