For solid sphereA,ρA(r)=k(rR)
Consider a spherical shell of radius x and thickness dx.
Mass of the shell, dm= density × volume
=(kxR)(4πx2dx)
So, moment of inertia of shell about its diameter,
dI=23(dm)x2=23(kxR)(4πx2dx)x2=(8π3kR)x5dx
∴ Moment of inertia of the sphere A,
IA=∫R0dI=8πk3R∫R0x5dx=8πk3R[x66]R0=(8πk18)R5....(i)
Similarly, for sphere B
IB=8πk3R5∫R0x9dx=(8πk3R5)[x1010]R0
∴IB=8πk30R5.....(ii)
From eqns. (i) and (ii), we get
IBIA=1830=610=n10∴n=6