Let $n> 2$ be an integer. A child has $n^2$ candies, which are distributed in $n$ boxes. An operation consists in choosing two boxes that together contain an even number of candies and redistribute the candy from those boxes so that both contain the same amount of candy. Determine all the values of $n$ for which the child, after some operations, can get each box containing $n$ candies, no matter which the initial distribution of candies is.
1. **Define the Problem and Notations:**
   - Let \( n > 2 \) be an integer.
   - A child has \( n^2 \) candies distributed in \( n \) boxes.
   - An operation consists of choosing two boxes that together contain an even number of candies and redistributing the candies so that both boxes contain the same amount.
   - We need to determine all values of \( n \) for which the child can make each box contain \( n \) candies, regardless of the initial distribution.

2. **Define Immovable Configuration:**
   - A configuration is called **immovable** if the child has no valid move to make.
   - We claim that an immovable configuration which isn't the one with \( n \) candies in every box exists if and only if \( n \) is not a power of two.

3. **Case 1: \( n \) is not a power of two:**
   - Let \( n \) be any positive integer which isn't a power of two.
   - Let \( v_2(n) = k \), where \( v_2 \) denotes the 2-adic valuation (the highest power of 2 dividing \( n \)).
   - Consider the configuration where the boxes contain \( 1, 1, \ldots, 1, \frac{n^2 - n + 2^k}{2^k}, \frac{n^2 - n + 2^k}{2^k}, \ldots, \frac{n^2 - n + 2^k}{2^k} \) candies, where there are \( n - 2^k \) boxes with 1 candy and \( 2^k \) boxes with \( \frac{n^2 - n + 2^k}{2^k} \) candies.
   - This is an immovable configuration since 1 is odd and \( \frac{n^2 - n + 2^k}{2^k} \) is even.
   - This shows that all non-powers of 2 don't work.

4. **Case 2: \( n \) is a power of two:**
   - Suppose \( n = 2^k \).
   - The only way for a configuration to be immovable is if there are two distinct values of the number of candies in the boxes, one odd and one even.
   - If there are \( t \) boxes with the odd number of candies and \( 2^k - t \) boxes with the even number of candies, then since \( v_2(t \cdot a + (2^k - t) \cdot b) = v_2(t) \) whenever \( a \) is odd and \( b \) is even, there are no immovable configurations for evens.

5. **Monovariant Argument:**
   - Let \( a_1, a_2, \ldots, a_n \) be variables corresponding to the number of candies in each box.
   - Consider the quantity \( \sum (a_i - a_j)^2 \).
   - This quantity decreases with each operation, ensuring that the child can always make progress towards the goal of having \( n \) candies in each box.

6. **Conclusion:**
   - The child can always achieve the goal if \( n \) is a power of 2.
   - If \( n \) is not a power of 2, there exist immovable configurations that prevent achieving the goal.

The final answer is all powers of \( \boxed{ 2 } \).