What is the least number of moves it takes a knight to get from one corner of an $n\times n$ chessboard, where $n\ge 4$, to the diagonally opposite corner?
1. **Define the problem and notation:**
   Let \( f(n) \) be the minimum number of moves required for a knight to travel from one corner of an \( n \times n \) chessboard to the diagonally opposite corner. We need to find \( f(n) \) for \( n \geq 4 \).

2. **Base cases:**
   - For \( n = 4 \):
     ```
     X...
     ....
     .X..
     ...X
     ```
     The knight can move from one corner to the diagonally opposite corner in 2 moves. Hence, \( f(4) \leq 2 \).

   - For \( n = 5 \):
     ```
     X....
     .....
     .X.X.
     .....
     ..X.X
     ```
     The knight can move from one corner to the diagonally opposite corner in 4 moves. Hence, \( f(5) \leq 4 \).

   - For \( n = 6 \):
     ```
     X.....
     ...X..
     .X....
     ....X.
     ......
     .....X
     ```
     The knight can move from one corner to the diagonally opposite corner in 4 moves. Hence, \( f(6) \leq 4 \).

3. **General case:**
   - By performing two moves as in the \( n = 4 \) board, we can reduce the problem from \( n \times n \) to \( (n-3) \times (n-3) \). Therefore, we have:
     \[
     f(n) = 2 + f(n-3)
     \]
   - By induction, we can solve the recursion to obtain:
     \[
     f(n) \leq 2 \left\lfloor \frac{n+1}{3} \right\rfloor
     \]
     In other words, if \( n = 3k-1 \) or \( 3k \) or \( 3k+1 \) for some integer \( k \), then \( f(n) \leq 2k \).

4. **Lower bound:**
   - Suppose the bottom-right corner is \((0,0)\), the bottom-left corner is \((n,0)\), and the top-left corner is \((n-1,n-1)\). Let the value of a square \((x,y)\) be \( x+y \).
   - Note that a knight can decrease the value of the square it's standing on by at most 3. Initially, the knight has a value of \( 2n-2 \) and it needs to decrease the value to 0. Therefore, the knight needs at least:
     \[
     \frac{2n-2}{3} \text{ moves}
     \]
   - Also, the knight always changes the parity of its value. Initially, it's even and at the end, it's also even, so the knight needs to take an even number of moves.

5. **Conclusion:**
   - Hence, \( f(n) \) must be at least the least even integer greater than or equal to \( \frac{2n-2}{3} \), or in other words:
     \[
     f(n) \geq 2 \left\lceil \frac{n-1}{3} \right\rceil
     \]
   - Note that since \( n \) is an integer, we have:
     \[
     \left\lceil \frac{n-1}{3} \right\rceil = \left\lfloor \frac{n+1}{3} \right\rfloor
     \]
     (use \( x = \lfloor x \rfloor + \{x\} \), \( \lceil x \rceil = -\lfloor -x \rfloor \), and \( \left\{ \frac{n}{3} \right\} \leq \frac{2}{3} \) if \( n \) is an integer; the proof is left to the reader).

6. **Final result:**
   - Therefore, we have:
     \[
     f(n) \geq 2 \left\lfloor \frac{n+1}{3} \right\rfloor
     \]
   - Combining the upper and lower bounds, we conclude:
     \[
     f(n) = 2 \left\lfloor \frac{n+1}{3} \right\rfloor
     \]

The final answer is \( \boxed{ f(n) = 2 \left\lfloor \frac{n+1}{3} \right\rfloor } \)