Energy of static electron lattices