A crazy physicist has discovered a new particle called an omon. He has a machine, which takes two omons of mass $a$ and $b$ and entangles them; this process destroys the omon with mass $a$, preserves the one with mass $b$, and creates a new omon whose mass is $\frac 12 (a+b)$. The physicist can then repeat the process with the two resulting omons, choosing which omon to destroy at every step. The physicist initially has two omons whose masses are distinct positive integers less than $1000$. What is the maximum possible number of times he can use his machine without producing an omon whose mass is not an integer?

[i]Proposed by Michael Kural[/i]
1. **Initial Setup**: We start with two omons of masses \(a\) and \(b\), where \(a\) and \(b\) are distinct positive integers less than 1000. Without loss of generality, assume \(a < b\).

2. **Entanglement Process**: The machine destroys the omon with mass \(a\), preserves the omon with mass \(b\), and creates a new omon with mass \(\frac{a + b}{2}\). This process can be repeated with the new pair of omons.

3. **Mass Difference Analysis**: Let \(d = b - a\). After the first entanglement, the new masses are \(b\) and \(\frac{a + b}{2}\). The difference between these new masses is:
   \[
   b - \frac{a + b}{2} = \frac{2b - (a + b)}{2} = \frac{b - a}{2} = \frac{d}{2}
   \]
   Thus, each entanglement halves the difference between the masses of the two omons.

4. **Integer Mass Condition**: For the mass of the new omon to remain an integer, \(\frac{a + b}{2}\) must be an integer. This implies that \(a + b\) must be even, which is always true since \(a\) and \(b\) are both integers.

5. **Maximum Number of Steps**: We need to determine the maximum number of times the physicist can use the machine without producing a non-integer mass. This is equivalent to finding the maximum number of times we can halve the initial difference \(d\) before it becomes less than 1.

6. **Initial Difference**: The maximum initial difference \(d\) is \(999\) (since \(a\) and \(b\) are distinct integers less than 1000).

7. **Halving Process**: We need to find the largest \(n\) such that:
   \[
   \frac{999}{2^n} \geq 1
   \]
   Solving for \(n\):
   \[
   999 \geq 2^n \implies n \leq \log_2(999)
   \]
   Calculating \(\log_2(999)\):
   \[
   \log_2(999) \approx 9.96
   \]
   Since \(n\) must be an integer, the maximum \(n\) is 9.

8. **Verification**: We can verify this by considering the sequence of differences:
   \[
   999, 499.5, 249.75, 124.875, 62.4375, 31.21875, 15.609375, 7.8046875, 3.90234375, 1.951171875
   \]
   After 9 steps, the difference is still greater than 1, but after the 10th step, it becomes less than 1, indicating a non-integer mass.

Conclusion:
The maximum number of times the physicist can use his machine without producing an omon whose mass is not an integer is \(\boxed{9}\).