Experimental and theoretical study of the energy loss of Be and B ions in Zn