A positive integer $n$ is given. A cube $3\times3\times3$ is built from $26$ white and $1$ black cubes $1\times1\times1$ such that the black cube is in the center of $3\times3\times3$-cube. A cube $3n\times 3n\times 3n$ is formed by $n^3$ such $3\times3\times3$-cubes. What is the smallest number of white cubes which should be colored in red in such a way that every white cube will have at least one common vertex with a red one.

[hide=thanks] Thanks to the user Vlados021 for translating the problem.[/hide]
To solve the problem, we need to determine the smallest number of white cubes that should be colored red in a $3n \times 3n \times 3n$ cube composed of $n^3$ smaller $3 \times 3 \times 3$ cubes, such that every white cube has at least one common vertex with a red cube.

1. **Understanding the Structure**:
   - Each $3 \times 3 \times 3$ cube has 26 white cubes and 1 black cube at the center.
   - We need to ensure that every white cube in the $3n \times 3n \times 3n$ cube has at least one common vertex with a red cube.

2. **2D Case Analysis**:
   - Consider a $3 \times 3$ grid with a black center. To cover all white squares, we need to color certain squares red.
   - The minimum number of red squares needed in a $3 \times 3$ grid is 4, placed at the corners.

3. **3D Case Analysis**:
   - For a $3 \times 3 \times 3$ cube, we need to extend the 2D case to 3D.
   - We can place red cubes at the corners of the $3 \times 3 \times 3$ cube. This requires 8 red cubes (one at each corner).

4. **Generalizing to $3n \times 3n \times 3n$**:
   - The $3n \times 3n \times 3n$ cube is composed of $n^3$ smaller $3 \times 3 \times 3$ cubes.
   - To ensure every white cube in the $3n \times 3n \times 3n$ cube has a common vertex with a red cube, we need to place red cubes at the corners of each $3 \times 3 \times 3$ sub-cube.

5. **Counting the Red Cubes**:
   - Each $3 \times 3 \times 3$ sub-cube requires 8 red cubes.
   - There are $n^3$ such sub-cubes in the $3n \times 3n \times 3n$ cube.
   - Therefore, the total number of red cubes needed is $8n^3$.

6. **Optimization**:
   - We can optimize by noting that some red cubes at the corners of adjacent sub-cubes overlap.
   - Specifically, each red cube at the corner of a $3 \times 3 \times 3$ sub-cube can serve as a corner for up to 8 adjacent sub-cubes.
   - Thus, the actual number of unique red cubes needed is significantly less than $8n^3$.

7. **Final Calculation**:
   - The optimal placement of red cubes involves placing them at the vertices of the $3n \times 3n \times 3n$ grid.
   - There are $(n+1)^3$ vertices in a $3n \times 3n \times 3n$ grid.
   - Therefore, the minimum number of red cubes needed is $(n+1)^3$.

The final answer is $\boxed{(n+1)^3}$.