The acceleration due to gravity \( g' \) on a planet is given by the formula:
\[
g' = \frac{GM}{R^2}
\]
where \( G \) is the gravitational constant, \( M \) is the mass of the planet, and \( R \) is the radius of the planet.
For Earth:
\[
g = \frac{GM_{\text{Earth}}}{R_{\text{Earth}}^2}
\]
Now, for the other planet with the same mass as Earth but with a diameter \( \frac{1}{3} \) of Earth's diameter, the radius of the planet \( R' \) is:
\[
R' = \frac{1}{3} R_{\text{Earth}}
\]
Substituting into the equation for acceleration due to gravity:
\[
g' = \frac{GM_{\text{Earth}}}{\left(\frac{1}{3} R_{\text{Earth}}\right)^2} = \frac{GM_{\text{Earth}}}{\frac{1}{9} R_{\text{Earth}}^2} = 9 \times \frac{GM_{\text{Earth}}}{R_{\text{Earth}}^2} = 9g
\]
Thus, the acceleration due to gravity on this planet is:
\[
g' = 9g
\]
Therefore, the value of \( n \) is \( \frac{1}{9} \).