Consider two distinct positive integers $a$ and $b$ having integer arithmetic, geometric and harmonic means. Find the minimal value of $|a-b|$. 

[i]Mircea Fianu[/i]
To find the minimal value of \( |a - b| \) for two distinct positive integers \( a \) and \( b \) such that their arithmetic mean, geometric mean, and harmonic mean are all integers, we proceed as follows:

1. **Arithmetic Mean Condition**:
   \[
   A = \frac{a + b}{2} \in \mathbb{N} \implies a + b \text{ is even} \implies a \equiv b \pmod{2}
   \]

2. **Geometric Mean Condition**:
   \[
   G = \sqrt{ab} \in \mathbb{N} \implies ab = G^2 \text{ for some integer } G
   \]
   Suppose without loss of generality that \( a > b \). Then we can write:
   \[
   a = kG \quad \text{and} \quad b = \frac{G}{k} \quad \text{for some integer } k \text{ such that } k \mid G
   \]
   Hence, \( a = bk^2 \).

3. **Harmonic Mean Condition**:
   \[
   H = \frac{2ab}{a + b} \in \mathbb{N}
   \]
   Substituting \( a = bk^2 \) and \( b \):
   \[
   H = \frac{2b \cdot bk^2}{bk^2 + b} = \frac{2bk^2}{k^2 + 1}
   \]
   Since \( k^2 \) and \( k^2 + 1 \) are coprime, it follows that \( k^2 + 1 \mid 2b \).

4. **Minimizing \( |a - b| \)**:
   We need to minimize \( |a - b| = |bk^2 - b| = b|k^2 - 1| \).

   Let \( c = k^2 - 1 \). We need to minimize \( b|c| \).

5. **Case Analysis**:
   - **Case 1: \( c \) is even**:
     Write \( c = 2d \). Then \( k^2 = 2d + 1 \) and \( k = \sqrt{2d + 1} \). We need \( 2d + 2 \mid 2b \), so \( b = e(d + 1) \) for some integer \( e \).

     The smallest \( d \) such that \( k \) is an integer is \( d = 2 \) (since \( k = \sqrt{5} \) is not an integer, but \( k = \sqrt{9} = 3 \) is). Thus, \( d = 2 \) gives \( c = 4 \).

     Therefore, \( b = e(2 + 1) = 3e \). The smallest \( b \) is 3. Hence, \( |a - b| = b|c| = 3 \cdot 4 = 12 \).

   - **Case 2: \( c \) is odd**:
     Write \( c = 2d + 1 \). Then \( k^2 = 2d + 2 \) and \( k = \sqrt{2d + 2} \). We need \( 2d + 3 \mid 2b \), so \( b = f(2d + 3) \) for some integer \( f \).

     The smallest \( d \) such that \( k \) is an integer is \( d = 1 \) (since \( k = \sqrt{4} = 2 \)). Thus, \( d = 1 \) gives \( c = 3 \).

     Therefore, \( b = f(1 + 1) = 2f \). The smallest \( b \) is 2. Hence, \( |a - b| = b|c| = 2 \cdot 3 = 6 \).

6. **Conclusion**:
   The minimal value of \( |a - b| \) is obtained in the second case when \( c = 3 \) and \( b = 2 \).

The final answer is \( \boxed{6} \).