TITLE: Ratio of balls in a box
QUESTION [6 upvotes]: A box contains some identical tennis balls. The ratio of the total volume of the tennis
balls to the volume of empty space surrounding them in the box is $1:k$, where $k$ is an
integer greater than one.
A prime number of balls is removed from the box. The ratio of the total volume of the
remaining tennis balls to the volume of empty space surrounding them in the box is 1:$k^2$.
Find the number of tennis balls that were originally in the box.
A few questions regarding this problem:
Does the shape of the box matter? I just let the volume of the box be a constant $V$. Also I noted that the ratio $\frac{1}{k^2} = \left( \frac{1}{k} \right)^2$. ie. New ratio is the old ratio squared. I also let the amount of balls in the box be $n$ and the amount of balls taken out be $p$ where $p$ is a prime, so the new amount of balls in the box is $n-p$.
This is about all I could do in this problem but I would like to be guided towards solving the problem (and I'm also interested in your thought processes and what ideas you initially think of so I can get a better idea of what to think of when doing problem solving) than just being given the solution.
Your help would be much appreciated.

REPLY [4 votes]: Let $n$ be the number of balls, $p$ be the number of balls taken away and $V$ be the volume of the box. 
When I first saw the problem, what stands out is the condition "$p$ is a prime". This suggests us setup some equations between $n$, $k$ and $p$ and then uses this condition to pose some constraint on $k$. If we do that, we have
$$n ( 1 + k ) = V = (n - p)(1 + k^2)\quad\implies\quad p(k^2+1) = nk(k-1)$$ 
Now $p$ is on LHS together with the factor $k^2+1$. To use the condition "$p$ is a prime",
we probably need to pick a factor $?$ from RHS so that $\gcd(?,k^2+1) = 1$. $k$ seems
to do the job,
$$k |p(k^2+1)\quad\stackrel{\gcd(k,k^2+1)=1}{\implies}\quad k | p \quad\stackrel{p \text{ is prime}}{\implies}\quad k = p$$
Once we get this, the remaining step is obvious. We express $n$ in terms of $k = p$
and see what can we do with that.
$$n = \frac{k^2+1}{k-1} = k + 1 + \frac{2}{k-1}\quad\stackrel{n\text{ is integer}}{\implies}\quad k = 2 \text{ or }3 \implies n = \frac{k^2+1}{k-1} = 5
$$
The result just follows.
$$(n,p,V) = (5,2,15) \text{ or } (5,3,20)$$