Theoretical investigations of the structures and binding energies of Ben and Mgn(n=3–5) clusters