What characteristics are shared by calcium and magnesium?