For which values of N is it possible to write numbers from 1 to N in some order so that for any group of two or more consecutive numbers, the arithmetic mean of these numbers is not whole?
To determine for which values of \( N \) it is possible to write the numbers from 1 to \( N \) in some order such that for any group of two or more consecutive numbers, the arithmetic mean of these numbers is not a whole number, we can proceed as follows:

1. **Check if \( N \) must be even:**
   - If \( N \) is odd, consider the sum of the first \( N \) natural numbers:
     \[
     1 + 2 + \ldots + N = \frac{N(N+1)}{2}
     \]
   - Since \( N \) is odd, \( N+1 \) is even, making \( \frac{N(N+1)}{2} \) an integer.
   - The arithmetic mean of all \( N \) numbers is:
     \[
     \frac{1 + 2 + \ldots + N}{N} = \frac{\frac{N(N+1)}{2}}{N} = \frac{N+1}{2}
     \]
   - Since \( N \) is odd, \( \frac{N+1}{2} \) is an integer, which contradicts the condition that the arithmetic mean of any group of two or more consecutive numbers should not be a whole number.
   - Therefore, \( N \) must be even.

2. **Construct an arrangement for even \( N \):**
   - Let \( N = 2k \) for some integer \( k \).
   - Consider the arrangement \( 2, 1, 4, 3, 6, 5, \ldots, 2k, 2k-1 \).
   - We need to check that for any group of two or more consecutive numbers in this arrangement, the arithmetic mean is not a whole number.

3. **Verify the arrangement:**
   - For any two consecutive numbers in the arrangement \( 2, 1, 4, 3, 6, 5, \ldots, 2k, 2k-1 \):
     \[
     \text{Pairs: } (2, 1), (1, 4), (4, 3), (3, 6), \ldots, (2k, 2k-1)
     \]
   - The arithmetic mean of each pair is:
     \[
     \frac{2+1}{2} = 1.5, \quad \frac{1+4}{2} = 2.5, \quad \frac{4+3}{2} = 3.5, \quad \frac{3+6}{2} = 4.5, \ldots, \frac{2k + (2k-1)}{2} = 2k - 0.5
     \]
   - None of these means are whole numbers.

4. **Generalize to groups of more than two consecutive numbers:**
   - Consider any group of \( m \) consecutive numbers in the arrangement. The sum of these numbers will always be odd because the sum of an even number and an odd number is odd.
   - Since the sum is odd and \( m \) is even, the arithmetic mean:
     \[
     \frac{\text{odd sum}}{m}
     \]
     will not be a whole number.

Thus, the arrangement \( 2, 1, 4, 3, 6, 5, \ldots, 2k, 2k-1 \) satisfies the condition for any even \( N \).

The final answer is \( \boxed{ N } \) must be even.