A magician and his assistant perform in front of an audience of many people.
On the stage there is an $8$×$8$ board, the magician blindfolds himself, and then the assistant goes inviting people from the public to write down the numbers $1, 2, 3, 4, . . . , 64$ in the boxes they want (one number per box) until completing the $64$ numbers. After the assistant covers two adyacent boxes, at her choice. Finally, the magician removes his blindfold and has to $“guess”$ what number is in each square that the assistant. Explain how they put together this trick.
$Clarification:$ Two squares are adjacent if they have a common side
1. **Establishing the Path:**
   - The magician and the assistant agree on a Hamiltonian cycle on the $8 \times 8$ board. A Hamiltonian cycle is a path that visits each square exactly once and returns to the starting square. One such path can be constructed as follows:
     - Start at the top-left corner (0,0).
     - Move right to (0,1), (0,2), ..., (0,7).
     - Move down to (1,7).
     - Move left to (1,6), (1,5), ..., (1,0).
     - Move down to (2,0).
     - Continue this zigzag pattern until reaching the bottom-right corner (7,7).
     - Finally, move up to (6,7), (6,6), ..., (6,0), and then down to (7,0), completing the cycle.

2. **Numbering the Squares:**
   - Number the squares from $0$ to $63$ according to the Hamiltonian cycle. This means each square $(i,j)$ on the board is assigned a unique number $k$ from $0$ to $63$.

3. **Audience Fills the Board:**
   - The audience fills the board with numbers $1$ to $64$ in any order. For simplicity, we can consider the numbers as $0$ to $63$ (mod $64$).

4. **Assistant's Calculation:**
   - Let $a_k$ be the number written on square $k$.
   - The assistant calculates the sum $S = 0 \cdot a_0 + 1 \cdot a_1 + 2 \cdot a_2 + \dots + 63 \cdot a_{63} \mod 64$.
   - The assistant then covers the squares $S$ and $S+1$ (mod $64$). These two squares are adjacent by the construction of the Hamiltonian cycle.

5. **Magician's Deduction:**
   - The magician removes the blindfold and sees which two squares are covered, thus knowing the value of $S$.
   - The magician sees the remaining 62 numbers on the board and can infer the two missing numbers $a_S$ and $a_{S+1}$.
   - The magician calculates the sum $T = S \cdot a_S + (S+1) \cdot a_{S+1} \mod 64$.
   - Since the magician knows $S$ and $T$, he can solve for $a_{S+1}$:
     \[
     a_{S+1} = \frac{T - S \cdot a_S}{S+1 - S} \mod 64 = T - S \cdot a_S \mod 64
     \]
   - Once $a_{S+1}$ is known, $a_S$ can be easily deduced.

\[
\boxed{a_{S+1} = T - S \cdot a_S \mod 64}
\]