Here's my working.
a) Make use of the formula ---> No of moles = Mass/Mr
Oxygen : 0.66712/16 = 0.041695
Carbon : 0.3853/12 = 0.032108
Hydrogen : 0.05178/1 = 0.05178
Nitrogen : 0.2247/14 = 0.01605
Phosphorus : 0.2981/31 = 0.0096161
b) To get the ratio, we divide everything by the smallest number which in this case is 0.0096161.
Example : Oxygen -----> 0.041695/0.0096161 = 13/3(nearest)
So the ratio is O : C : H : N : P
13/3 : 10/3 : 16/3 : 5/3 : 1
Now we just have to multiply by 3 to get
C10O13N5H16P3. This is the empirical formula.

d) The empirical formula gives us an Mr of 494.
494n = 507 which is almost n=1.
Hence the molecular formula is equal to the empirical one.

Molecular formula :
C10O13N5H16P3