Suppose, the mass of the core of the planet is m and that of the outer shell is m.
So, field on the surface of core is GmR2.
And,on the surface of the shell it will be G(m+m′)(2R)2.
GmR2=G(m+m′)(2R)2.
4m=m+m′
m=3m
Let m=43πR3ρ1
3m=3(43πR3ρ1)=m′=43π7R3ρ2
ρ1=73ρ2
ρ1ρ2=73