Determine all positive integers $n$ for which there exists a polynomial $f(x)$ with real coefficients, with the following properties:

(1) for each integer $k$, the number $f(k)$ is an integer if and only if $k$ is not divisible by $n$;
(2) the degree of $f$ is less than $n$.

[i](Hungary) Géza Kós[/i]
1. **Understanding the Problem:**
   We need to find all positive integers \( n \) for which there exists a polynomial \( f(x) \) with real coefficients such that:
   - For each integer \( k \), \( f(k) \) is an integer if and only if \( k \) is not divisible by \( n \).
   - The degree of \( f \) is less than \( n \).

2. **Using Lagrange Interpolation:**
   Applying Lagrange's interpolation formula on \( n \) values of \( f \) which are integers, we conclude that \( f \in \mathbb{Q}[X] \). Therefore, we can consider \( F(X) = N \cdot f(X) \) where \( N \) is the common denominator of all the coefficients of \( f \). Thus, \( F \in \mathbb{Z}[X] \) with the condition that \( N \mid F(k) \) if and only if \( n \nmid k \).

3. **Analyzing the Divisibility Condition:**
   Let \( d = \gcd(N, n) \). We see that if \( n \nmid k \), then \( d \mid N \mid F(k) \). Moreover, we claim that \( d \nmid F(0) \). Indeed, choose \( k = n \) and see that our condition gives that \( N \nmid F(n) \). However, if \( g = \frac{N}{d} \), then \( \gcd(n, g) = 1 \) and we have \( n \equiv r \pmod{g} \) for some \( 1 \le r \le g-1 \). This yields that \( F(n) \equiv F(r) \equiv 0 \pmod{g} \). Therefore, \( d \nmid F(n) \), however, \( F(n) \equiv F(0) \pmod{d} \).

4. **Claiming \( d = n \):**
   Suppose not, and let \( d < n \). Set \( k = dm \) for some positive integer \( m \) relatively prime to \( n \). We have \( n \nmid dm \) and so \( N \mid F(dm) \), in particular, \( F(dm) \equiv F(0) \pmod{d} \), which is clearly false. We conclude that \( d = n \).

5. **New Condition:**
   Thus, we have the new condition: \( n \mid F(j) \) for all \( 1 \le j \le n-1 \) and \( n \nmid F(0) \). Suppose that \( n \) is not a prime power. Then let \( p \) be a prime with exponent \( a \) such that \( p^a \mid n \). We have \( p^a \mid n \mid F(p^a) \) yielding that \( p^a \mid F(0) \). Applying this for all prime powers dividing \( n \), we get \( n \mid F(0) \). Thus, we arrive at a contradiction.

6. **Conclusion:**
   Note that the above argument doesn't yield a contradiction if \( n \) is a prime power since then \( 1 \le p^a \le n-1 \) does not hold.

The final answer is the only positive integers \( \boxed{ n } \) which satisfy our conditions are the powers of prime numbers.