Firslty, we need to find the empirical formula. Assuming the eprcentages are in mass, we first need to to divide each by the atomic weight of the corresponding atom to find the number of moles correspondent of the percentages.
We can use either the percentage or the decimal form, so let's use the decimal:

The atomic masses are:

So, making the division, we have:

Now, we divide one by the other. Since has a bigger number, we can divide it by the P to get the ratio S to P:

This means that for each 5 S we have 2 P, so the empirical formula is:

Now, the molar mass of this empirical formula is:

To see how many of the empirical formula there are in each of the compound, we divide the molar mass of the compound by the molar mass of its empirical formula:

So, the actual compound has twice the amount of atoms compared to the empirical formula, so its molecular formula is:
