In the picture below, a white square is surrounded by four black squares and three white squares. They are surrounded by seven black squares.
[img]https://i.stack.imgur.com/Dalmm.png[/img]
What is the maximum number of white squares that can be surrounded by $ n $ black squares?

To solve the problem of finding the maximum number of white squares that can be surrounded by \( n \) black squares, we need to analyze the configurations of squares and their relationships. We will consider different cases based on the arrangement of the squares.

1. **Initial Setup and Claims:**
   - We start by noting that the white squares are surrounded by black squares. Let \( a, b, c, d \) be the number of black squares on each side of the white square region.
   - By the problem's constraints, none of the numbers \( a, b, c, d \) can be greater than 2. If \( a = c = 2 \), it is possible to find a configuration with more white squares, as shown in Figure 4 (not provided here). Therefore, in the best scenario, the polygon does not have two opposite sides of size 2.

2. **Case Analysis:**
   - **Case 1:** \( a = b = c = d = 1 \)
     - In this case, we have a parallelogram configuration. The number of black squares is given by:
       \[
       n = 4 + 2(x + y)
       \]
       This equation is only possible for even \( n \). The number of white squares is:
       \[
       xy + (x+1)(y+1) = 2xy + x + y + 1
       \]
       Replacing \( n \) in the equation, we get:
       \[
       2x \left( \frac{n-4}{2} - x \right) + x + \frac{n-4}{2} - x + 1 = -2x^2 + (n-4)x + \frac{n-4}{2} + 1
       \]
       This quadratic function has a maximum point at:
       \[
       x = \frac{n-4}{4}
       \]
       - If \( n = 4k \), then \( \frac{n-4}{4} = k-1 \) and the number of white squares is:
         \[
         2k^2 - 2k + 1
         \]
       - If \( n = 4k + 2 \), then \( \frac{n-4}{4} = k - \frac{1}{2} \), which is not an integer. Looking at the nearest integers \( \{k, k+1\} \), the number of white squares is:
         \[
         2k^2
         \]

   - **Case 2:** \( a = d = 2 \) and \( b = c = 1 \)
     - The number of white squares surrounded is:
       \[
       x + 1 + (x+1)y + (x+2)(y+1) = (2x+3)(y+1)
       \]
       The number of black squares is:
       \[
       n = 6 + 2x + 1 + 2y = 7 + 2(x + y)
       \]
       So \( n \) is odd. The quadratic function is:
       \[
       (2x+3) \left( \frac{n-7}{2} - x + 1 \right) = -2 \left( x + \frac{3}{2} \right) \left( x - \frac{n-5}{2} \right)
       \]
       This quadratic function has a maximum point at:
       \[
       x = \frac{n-8}{4}
       \]
       - If \( n = 4k + 1 \), then \( \frac{n-8}{4} = k - \frac{7}{4} \). Looking at the nearest integers \( \{k-2, k-1\} \), the number of white squares is:
         \[
         2k^2 - k
         \]
       - If \( n = 4k + 3 \), then \( \frac{n-8}{4} = k - \frac{5}{4} \). Looking at the nearest integers \( \{k-2, k-1\} \), the number of white squares is:
         \[
         2k^2 + k
         \]

The final answer is \( \boxed{ 2k^2 - 2k + 1 } \) for \( n = 4k \), \( 2k^2 \) for \( n = 4k + 2 \), \( 2k^2 - k \) for \( n = 4k + 1 \), and \( 2k^2 + k \) for \( n = 4k + 3 \).