For even positive integer $n$ we put all numbers $1,2,...,n^2$ into the squares of an $n\times n$ chessboard (each number appears once and only once).
Let $S_1$ be the sum of the numbers put in the black squares and $S_2$ be the sum of the numbers put in the white squares. Find all $n$ such that we can achieve $\frac{S_1}{S_2}=\frac{39}{64}.$
1. We start by noting that the sum of the first \( n^2 \) natural numbers is given by:
   \[
   \sum_{i=1}^{n^2} i = \frac{n^2(n^2 + 1)}{2}
   \]
   This is derived from the formula for the sum of the first \( k \) natural numbers, \( \sum_{i=1}^k i = \frac{k(k+1)}{2} \).

2. Let \( S_1 \) be the sum of the numbers on the black squares and \( S_2 \) be the sum of the numbers on the white squares. We are given that:
   \[
   \frac{S_1}{S_2} = \frac{39}{64}
   \]
   This implies:
   \[
   64S_1 = 39S_2
   \]

3. Since the total sum of all numbers is \( \frac{n^2(n^2 + 1)}{2} \), we have:
   \[
   S_1 + S_2 = \frac{n^2(n^2 + 1)}{2}
   \]

4. Substituting \( S_2 \) from the ratio equation, we get:
   \[
   S_2 = \frac{64}{39} S_1
   \]
   Plugging this into the total sum equation:
   \[
   S_1 + \frac{64}{39} S_1 = \frac{n^2(n^2 + 1)}{2}
   \]
   Simplifying, we get:
   \[
   S_1 \left(1 + \frac{64}{39}\right) = \frac{n^2(n^2 + 1)}{2}
   \]
   \[
   S_1 \left(\frac{39 + 64}{39}\right) = \frac{n^2(n^2 + 1)}{2}
   \]
   \[
   S_1 \left(\frac{103}{39}\right) = \frac{n^2(n^2 + 1)}{2}
   \]
   \[
   S_1 = \frac{39}{103} \cdot \frac{n^2(n^2 + 1)}{2}
   \]

5. For \( S_1 \) to be an integer, \( \frac{39}{103} \cdot \frac{n^2(n^2 + 1)}{2} \) must be an integer. This implies that \( 103 \) must divide \( n^2(n^2 + 1) \).

6. Since \( 103 \) is a prime number, it must divide either \( n^2 \) or \( n^2 + 1 \). However, \( 103 \) cannot divide \( n^2 + 1 \) because \( n^2 + 1 \) is always one more than a multiple of \( 103 \). Therefore, \( 103 \) must divide \( n^2 \), which implies \( 103 \mid n \).

7. Let \( n = 103k \) for some integer \( k \). We need to check if such \( n \) satisfies the condition. Substituting \( n = 103k \) into the sum formula:
   \[
   S_1 = \frac{39}{103} \cdot \frac{(103k)^2((103k)^2 + 1)}{2}
   \]
   \[
   S_1 = \frac{39}{103} \cdot \frac{103^2 k^2 (103^2 k^2 + 1)}{2}
   \]
   \[
   S_1 = \frac{39 \cdot 103^2 k^2 (103^2 k^2 + 1)}{2 \cdot 103}
   \]
   \[
   S_1 = \frac{39 \cdot 103 k^2 (103^2 k^2 + 1)}{2}
   \]
   Since \( 103 k^2 (103^2 k^2 + 1) \) is an integer, \( S_1 \) is an integer.

8. Therefore, the condition \( \frac{S_1}{S_2} = \frac{39}{64} \) can be achieved if and only if \( n \) is a multiple of \( 103 \).

The final answer is \( \boxed{ n = 103k } \) for any positive integer \( k \).