Spring compressed between two blocks I´m trying to solve this problem and I don't understand it well. 
We have a block whose mass is $m_2$, a block whose mass is $ m_1$, and a spring of length $8a$. If you connect the blocks like this:
m1
v
v
v
v
v
v
m2

The spring will be compressed, so its length will be only $7a$. Then you compress it even more to the length $4a$. You should then show that if $m_2<2 m_1$, the lower block will lift off from the floor. 
Well, I can find the spring constant, but I´m not sure I understand what will happen. I suppose that the maximal amplitude will be $10a$ and that is when the upper block reaches this amplitude, the lower one should lift off. 
So, we need that the force in the position of maximal amplitude (let's call it A) be more than $m_1 g + m_2g$. However, I thought that there is also the force of the spring, which should have the same direction as both gravity forces in that position A, but that just doesn't make sense.  
I feel it should be like this, however, I don´t understand the forces in it and if it is connected also with some energy.
 A: Since you have "done the work" (as much in the comments as in the original question...) but are left with a small uncertainty about the concept of what force applies where, I feel I can now write an actual answer.
The following diagram explains it (gravity operates from right to left in my picture so the text aligns better):

The spring compresses by $(8-7)a = a$ when a force of $m_1 g$ is applied. We conclude that the spring constant $k = m_1 g / a$.
From this equilibrium position, the top mass will move symmetrically with respect to the $7a$ position as long as $m_2$ stays on the ground. Thus, when it has been compressed to $4a$ (a deflection of $3a$) it will oscillate with an amplitude of $3a$, reaching a maximum extension of the spring of $(7+3)a = 10a$.
At this point, the spring has been stretched by $(10 - 8) a = 2a$ (remember the unstretched string had a length of $8a$). And the force it exerts on $m_2$ is therefore
$$F_2 = k x = \frac{m_1 g}{a} (2a) = 2 m_1 g$$
That is a force that is just enough to pick up a mass $m_2 = 2 m_1$.
