What relative masses are required for them to collide n times in this scenario? Consider two masses, m and M, where M>m. They begin at rest on an infinite frictionless surface that is flat in one direction and sloped in the other direction. Mass m is placed a little bit up the slope so that it slides down and collides perfectly elastically with the stationary mass M. After the collision, mass m goes back up the slope and back down again, while mass M moves along the infinite slope.

If M is much more massive than m, it will barely move after the collision, while m will go almost all the way back up the slope and come down with enough velocity to catch up with M and collide with it again (Imagine a ping-pong ball and a monster truck). However, if M is only slightly more massive than m, M will move away with significant velocity, while m will barely go back up the slope and come back down with insufficient velocity to collide with M again. 
For the first collision, I have calculated that the tipping point where m and M switch from colliding again to not colliding again to be 3M: Using the convention that $v_n$ is the velocity of m after $n$ collisions and $V_n$ is the velocity of M after $n$ collisions, and given that $V_0=0,$
$v_1 = \frac{m-M}{m+M}v_0,\ \ \ V_1 = \frac{2m}{m+M}v_0$
However, after going up and down the ramp again, the velocity of m is reversed:
$v_1' = -v_1 = \frac{M-m}{M+m}v_0$
The masses will collide again if $v_1'>V_1$ 
$\frac{M-m}{M+m}v_0 > \frac{2m}{M+m}v_0$
$M-m > 2m,\ \ \ \ M>3m$
However, I can not generalize this for $n$ collisions. Since algebra can get messy for elastic collisions where both masses have initial velocity, so I adjust the reference frame after each collision such that M is stationary.
$V_1' = 0, \ \ \ v_1'' = \frac{M-m}{M+m}v_0 - \frac{2m}{M+m}v_0 = \frac{M-3m}{M+m}v_0$
From this point, the masses collide again if $\frac{M-3m}{M+m}v_0>0$, which can be easily evaluated. However, when one carries this out for the second, third, fourth, etc. collision, the pattern emerges:
$v_n = (\frac{M-3m}{M+m})^nv_0$, which is >0 for the same condition, M>3m. This leads to an unintuitive conclusion: if $M\leq3m$, the masses collide only once. If $M>3m$, the masses collide infinitely many times. This result just seems like it can't possibly be correct. Is there a better way to evaluate this situation for the case of n collisions that may give a better answer?
One thought I had is that the speed of the reference frame may exceed the speed of m after a certain number of collisions, so that m never gets back to the slope. However, I can't find a way to evaluate this.
 A: Start by noting the velocities ($v$ and $V$) of both blocks (mass $m$ and $M$) after a collision, noting the shorthand $\delta = M-m$ and $\mu = M+m$:
$$\begin{align}
v_\textrm{after} &= -\frac{\delta}{\mu}v_\textrm{before}+\frac{2m_2}{\mu}V_\textrm{after} \\
V_\textrm{after} &= \frac{2m_1}{\mu}v_\textrm{before}+\frac{\delta}{\mu}V_\textrm{after}
\end{align}$$
Several things to note now: firstly, for a solution to exist at all, we require $m<M$, or the block at the bottom of the slope will be kicked away too quickly and never caught up again; secondly, because the system is frictionless and elastic, block $m$ will return for subsequent collisions with exactly $-v_\textrm{after}$; and thirdly we can drop usage of $\mu$ because the system is scale independent (and as we'll see, we use ratios in which this would drop out anyway).
Now I will denote the velocities immediately after collision $n$ by $V_n$ and $v_n$ respectively (with $V_0 =0$ as the larger block starts at rest).
So, we can write this in matrix form:
$$
\begin{bmatrix}
v_n\\ 
V_n
\end{bmatrix} =
\begin{bmatrix}
\delta & \ -2m_2\\ 
\ 2m_1 & \delta
\end{bmatrix}^n 
\begin{bmatrix}
v_0\\ 
V_0
\end{bmatrix}$$
To solve this, we'll need to diagonalise the central matrix, which turns out to be:
$$
A = SJS^{-1}= 
\frac{1}{2}
\begin{bmatrix}
\ -i\sqrt{\frac{m_2}{m_1}} & \ i\sqrt{\frac{m_1}{m_2}}\\ 
\  1& 1
\end{bmatrix}
\begin{bmatrix}
\alpha_+ & \ 0\\ 
\ 0 & \alpha_-
\end{bmatrix}
\begin{bmatrix}
\ -i\sqrt{\frac{m_1}{m_2}} & \ 1\\ 
\ i\sqrt{\frac{m_1}{m_2}} & 1
\end{bmatrix}
$$
where the shorthand $\alpha_{\pm} = \delta\pm2i\sqrt{4m_1m_2}$.
On expansion, this gives us a useful form for $A^n$:
$$
\frac{1}{2}
\begin{bmatrix}
(\alpha_+^n+\alpha_-^n)& i\sqrt{\frac{m_2}{m_1}}(\alpha_+^n-\alpha_-^n)\\ 
i\sqrt{\frac{m_1}{m_2}}(\alpha_+^n-\alpha_-^n) & (\alpha_+^n+\alpha_-^n)
\end{bmatrix}
$$
Then to solve for $n$, we note that the value of $v_n/V_n$ must be $1$ or less. So, putting it all together and noting that $V_0 = 0$, we must solve:
$$
1=i\sqrt{\frac{m_2}{m_1}}\frac{\alpha_+^n + \alpha_-^n}{\alpha_+^n - \alpha_-^n}
$$
and hence:
$$
n = \frac{\log(1+i\sqrt{\frac{m_1}{m_2}})-\log(1-i\sqrt{\frac{m_1}{m_2}})}{\log(\alpha_+)-\log(\alpha_-)}
$$
which, despite the imaginary components, does give real answers!
A: As you describe, let $v_n$ and $V_n$ be the velocities of masses $m$ and $M$ just before the $(n+1)$th collision (so both move to the right). $V_0$=0.
In each collision, you have two conservation laws you can use: energy and momentum. Being careful about directions, you get
$$
m v_n + M V_n = -m v_{n+1}+M V_{n+1}\\
\frac{1}{2}m v_n^2 + \frac{1}{2}M V_n^2 = \frac{1}{2}m v_{n+1}^2+\frac{1}{2}M V_{n+1}^2
$$
Now solve these for $v_{n+1}$ and $V_{n+1}$ and you should get them linearly in terms of $v_n$ and $V_n$. You can solve the recurrence relation (for example by daigonalising the matrix giving the linear relation) to get $v_n$ and $V_n$, and find out how many impacts there will be from that.
Now take $M=10^{2k}m$, and note that for $k=0,1,2,3,4,\ldots,10,\ldots$ you get the number of impacts being $3,31,314,3141,31415,\ldots,31415926535,\ldots$
Finally, build a very smooth slope and compute $\pi$ using a ping-pong ball and a monster truck of appropriate masses.
[See Galperin's billiards]
