Total energies in Se. I. The trigonal crystal