The percentage of phosphourus in a detergent product may be determined by sample treatment including the precipitation of magnesium ammonium phosphate MgNH4PO4*6H2O (MW=245.41), using an excess of both magnesium and ammonium ions. The separated ans washed precipitate is then heated strongly to decompose it to magnesium pyrophosphate Mg2P2O7 (MW=222.57), which is weighted. If a 5.00 g sample of a detergent yielded 0.225 g of the weighing form, calculate the percent of phosphorus (MW=30.97) in the sample.

Thanks for any help/

Determine the percent composition of P in Mg2P2O7 from the formula.
Then, the mass of P is .225 x that percentage.

percent P in detergent= 100*massP/5.00

check my thinking.

I'm confused in determing the percent composition of P in Mg2P2O7. I'm not quite sure what formula to use.