Purification by conversion of the silicon into a compound, optional purification of the compound, and reconversion into silicon