The time period of an artificial satellite revolving very close to the planet's surface is T=2πGMR3
where M is the mass of the planet and R its radius.
Assuming the planet to be of uniform density d, so its mass is M=34πR3d ( as density = volume mass ) ∴dT=2πG(34πR3d)R3 =Gd3π or T∝d1