---
# System prepended metadata

title: hypercube
tags: [meeting]

---

## The Laplacian matrix of the hypercube

$$L(Q_n)=\begin{pmatrix} L(Q_{n-1})+I & -I \\ -I & L(Q_{n-1})+I \end{pmatrix}_{2^n\times2^n}$$

---
In the following, we fix $v_1$ has $-N$ and $v_2$ has  $N$, and the way to decide remaining vertices follows the laplacian matrix of the hypercube above.
所以下圖的頂點逆時針依序是$(v_1, v_2, v_4, v_3)$，而不是$(v_1, v_2, v_3, v_4)$

## Hypercube

### For 2-cube (N=4)

![image](https://hackmd.io/_uploads/HyLMPs0u0.png)



$$\tilde{L}=\begin{pmatrix} 2 & 0 & -1 \\ 0 & 2 & -1 \\-1 & -1 & 2 \\ \end{pmatrix}, \quad \tilde{L}^{-1}\begin{pmatrix} 4 \\ 0 \\ 0  \end{pmatrix}=\begin{pmatrix} 3 \\ 1 \\ 2  \end{pmatrix} \quad \Rightarrow  \sigma=(0, 3, 1, 2)$$

\begin{split}
    (-4, 4, 0, 0) &\stackrel{v_2}\to (-3, 2, 0, 1)\\\\
    &\stackrel{v_2}\to (-2, 0, 0, 2) \\\\
    &\stackrel{v_2}\to (-1, -2, 0, 3) \\\\
    &\stackrel{v_3}\to (0, -2, -2, 4) \\\\
    &\stackrel{v_4}\to (0, -1, -1, 2) \\\\
    &\stackrel{v_4}\to (0, 0, 0, 0)
\end{split}

$\text{len}(\sigma):=\sum_i \sigma_{(i)}=0+3+2+1=6=3\times 2^1$ 

**Guess:** For $n$-cube, $\text{len}(\sigma)= \sigma_{(2)} \times 2^{n-1}\quad$ ( 總發射次數 $=v_2$ 發射次數 $\times  2^{n-1}$ )

1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

| $\sigma_{(1)}, \sigma_{(3)}$ |  0  |  1  |
|:----------------------------:|:---:|:---:|
| $\sigma_{(2)}, \sigma_{(4)}$ |  3  |  2  |
|          column sum          |  3  |  3  |

2. $n$ 整除 $a(1,1)$
$n=2 \ | \ 2$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=2=4/2=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=0$

```
def chip_firing_game(initial_state, firing_sequence):
    cube = list(initial_state)
    results = [cube.copy()]
    
    neighbors = {
        1: [2, 3],
        2: [1, 4],
        3: [1, 4],
        4: [2, 3]
    }
    
    for vertex in range(1, 5):
        for _ in range(firing_sequence[vertex-1]):
            cube[vertex-1] -= 2
            for neighbor in neighbors[vertex]:
                cube[neighbor-1] += 1
            results.append(cube.copy())
    
    return results

def print_cube_state(state):
    print(state)

initial_state = [-4, 4, 0, 0]
firing_sequence = [0, 3, 1, 2]

results = chip_firing_game(initial_state, firing_sequence)

for i, state in enumerate(results):
    print(f"Step {i}:", end=" ")
    print_cube_state(state)
```

```
Step 0: [-4, 4, 0, 0]
Step 1: [-3, 2, 0, 1]
Step 2: [-2, 0, 0, 2]
Step 3: [-1, -2, 0, 3]
Step 4: [0, -2, -2, 4]
Step 5: [0, -1, -1, 2]
Step 6: [0, 0, 0, 0]
```


---
### For 3-cube (N=24)

![image](https://hackmd.io/_uploads/S1oF78kYR.png =40%x)


$$\tilde{L}=\begin{pmatrix} 3 & 0 & -1 & 0 & -1 & 0 & 0 \\
0 & 3 & -1 & 0 & 0 & -1 & 0 \\
-1 & -1 & 3 & 0 & 0 & 0 & -1 \\
0 & 0 & 0 & 3 & -1 & -1 & 0 \\
-1 & 0 & 0 & -1 & 3 & 0 & -1 \\
0 & -1 & 0 & -1 & 0 & 3 & -1 \\
0 & 0 & -1 & 0 & -1 & -1 & 3 \end{pmatrix}, \quad \tilde{L}^{-1}\begin{pmatrix} 24 \\ 0 \\ 0\\ 0\\ 0\\ 0\\ 0  \end{pmatrix}=\begin{pmatrix} 14 \\ 5 \\ 9 \\ 5 \\ 9 \\ 6 \\ 8  \end{pmatrix} \quad $$
$$\Rightarrow  \sigma=(0, 14, 5, 9, 5, 9, 6, 8)$$$$\Rightarrow  v_3=v_5,\quad v_4=v_6$$

We only need to consider 6 vertices: $v_1, v_2, v_3, v_4, v_7, v_8$

![image](https://hackmd.io/_uploads/Bk1w7LkYC.png)


$\text{len}(\sigma)=0+14+5+9+5+9+6+8=56=14\times 2^2$ 


1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

|            |  0  | 5   |  6  |
|:----------:|:---:| --- |:---:|
|            | 14  | 9   |  8  |
| column sum | 14  | 14  | 14  |

2. $n$ 整除 $a(1,1)$
$n=3 \ | \ 9$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=8=24/3=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=2$

```
def chip_firing_game(initial_state, firing_sequence):
    cube = list(initial_state)
    results = [cube.copy()]
    
    neighbors = {
        1: [2, 3, 5],
        2: [1, 4, 6],
        3: [1, 4, 7],
        4: [2, 3, 8],
        5: [1, 6, 7],
        6: [2, 5, 8],
        7: [3, 5, 8],
        8: [4, 6, 7]
    }
    
    for vertex in range(1, 9):
        for _ in range(firing_sequence[vertex-1]):
            cube[vertex-1] -= 3
            for neighbor in neighbors[vertex]:
                cube[neighbor-1] += 1
            results.append(cube.copy())
    
    return results

def print_cube_state(state):
    print(state)

initial_state = [-24, 24, 0, 0, 0, 0, 0, 0]
firing_sequence = [0, 14, 5, 9, 5, 9, 6, 8]

results = chip_firing_game(initial_state, firing_sequence)

for i, state in enumerate(results):
    print(f"Step {i}:", end=" ")
    print_cube_state(state)
```

```
Step 0: [-24, 24, 0, 0, 0, 0, 0, 0]
Step 1: [-23, 21, 0, 1, 0, 1, 0, 0]
Step 2: [-22, 18, 0, 2, 0, 2, 0, 0]
Step 3: [-21, 15, 0, 3, 0, 3, 0, 0]
Step 4: [-20, 12, 0, 4, 0, 4, 0, 0]
Step 5: [-19, 9, 0, 5, 0, 5, 0, 0]
Step 6: [-18, 6, 0, 6, 0, 6, 0, 0]
Step 7: [-17, 3, 0, 7, 0, 7, 0, 0]
Step 8: [-16, 0, 0, 8, 0, 8, 0, 0]
Step 9: [-15, -3, 0, 9, 0, 9, 0, 0]
Step 10: [-14, -6, 0, 10, 0, 10, 0, 0]
Step 11: [-13, -9, 0, 11, 0, 11, 0, 0]
Step 12: [-12, -12, 0, 12, 0, 12, 0, 0]
Step 13: [-11, -15, 0, 13, 0, 13, 0, 0]
Step 14: [-10, -18, 0, 14, 0, 14, 0, 0]
Step 15: [-9, -18, -3, 15, 0, 14, 1, 0]
Step 16: [-8, -18, -6, 16, 0, 14, 2, 0]
Step 17: [-7, -18, -9, 17, 0, 14, 3, 0]
Step 18: [-6, -18, -12, 18, 0, 14, 4, 0]
Step 19: [-5, -18, -15, 19, 0, 14, 5, 0]
Step 20: [-5, -17, -14, 16, 0, 14, 5, 1]
Step 21: [-5, -16, -13, 13, 0, 14, 5, 2]
Step 22: [-5, -15, -12, 10, 0, 14, 5, 3]
Step 23: [-5, -14, -11, 7, 0, 14, 5, 4]
Step 24: [-5, -13, -10, 4, 0, 14, 5, 5]
Step 25: [-5, -12, -9, 1, 0, 14, 5, 6]
Step 26: [-5, -11, -8, -2, 0, 14, 5, 7]
Step 27: [-5, -10, -7, -5, 0, 14, 5, 8]
Step 28: [-5, -9, -6, -8, 0, 14, 5, 9]
Step 29: [-4, -9, -6, -8, -3, 15, 6, 9]
Step 30: [-3, -9, -6, -8, -6, 16, 7, 9]
Step 31: [-2, -9, -6, -8, -9, 17, 8, 9]
Step 32: [-1, -9, -6, -8, -12, 18, 9, 9]
Step 33: [0, -9, -6, -8, -15, 19, 10, 9]
Step 34: [0, -8, -6, -8, -14, 16, 10, 10]
Step 35: [0, -7, -6, -8, -13, 13, 10, 11]
Step 36: [0, -6, -6, -8, -12, 10, 10, 12]
Step 37: [0, -5, -6, -8, -11, 7, 10, 13]
Step 38: [0, -4, -6, -8, -10, 4, 10, 14]
Step 39: [0, -3, -6, -8, -9, 1, 10, 15]
Step 40: [0, -2, -6, -8, -8, -2, 10, 16]
Step 41: [0, -1, -6, -8, -7, -5, 10, 17]
Step 42: [0, 0, -6, -8, -6, -8, 10, 18]
Step 43: [0, 0, -5, -8, -5, -8, 7, 19]
Step 44: [0, 0, -4, -8, -4, -8, 4, 20]
Step 45: [0, 0, -3, -8, -3, -8, 1, 21]
Step 46: [0, 0, -2, -8, -2, -8, -2, 22]
Step 47: [0, 0, -1, -8, -1, -8, -5, 23]
Step 48: [0, 0, 0, -8, 0, -8, -8, 24]
Step 49: [0, 0, 0, -7, 0, -7, -7, 21]
Step 50: [0, 0, 0, -6, 0, -6, -6, 18]
Step 51: [0, 0, 0, -5, 0, -5, -5, 15]
Step 52: [0, 0, 0, -4, 0, -4, -4, 12]
Step 53: [0, 0, 0, -3, 0, -3, -3, 9]
Step 54: [0, 0, 0, -2, 0, -2, -2, 6]
Step 55: [0, 0, 0, -1, 0, -1, -1, 3]
Step 56: [0, 0, 0, 0, 0, 0, 0, 0]
```



---

### For 4-cube (N=96)

![image](https://hackmd.io/_uploads/rkbGVUyFR.png =50%x)


$$\tilde{L}=\begin{pmatrix} 4 & 0 & -1 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 4 & -1 & 0 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 \\
-1 & -1 & 4 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 4 & -1 & -1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 \\
-1 & 0 & 0 & -1 & 4 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 \\
0 & -1 & 0 & -1 & 0 & 4 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 \\
0 & 0 & -1 & 0 & -1 & -1 & 4 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 4 & -1 & -1 & 0 & -1 & 0 & 0 & 0 \\
-1 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 4 & 0 & -1 & 0 & -1 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 4 & -1 & 0 & 0 & -1 & 0 \\
0 & 0 & -1 & 0 & 0 & 0 & 0 & 0 & -1 & -1 & 4 & 0 & 0 & 0 & -1 \\
0 & 0 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 4 & -1 & -1 & 0 \\
0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & -1 & 4 & 0 & -1 \\
0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & -1 & 0 & 4 & -1 \\
0 & 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & -1 & 0 & -1 & -1 & 4 \end{pmatrix}$$ $$\tilde{L}^{-1}\begin{pmatrix} 96 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0  \end{pmatrix}=\begin{pmatrix} 45 \\ 17 \\ 28 \\ 17 \\ 28 \\ 20 \\ 25 \\ 17 \\ 28 \\ 20 \\ 25 \\ 20 \\ 25 \\ 21 \\ 24  \end{pmatrix} \quad \Rightarrow  \sigma=(0, 45, 17, 28, 17, 28, 20, 25, 17, 28,  20, 25, 20, 25, 21, 24)$$$$\Rightarrow  v_3=v_5=v_9,\quad v_4=v_6=v_{10},\quad v_7=v_{11}=v_{13},\quad v_8=v_{12}=v_{14}$$

We only need to consider 8 vertices: $v_1, v_2, v_3, v_4, v_7, v_8, v_{15}, v_{16}$

![image](https://hackmd.io/_uploads/r1pBBI1FA.png =70%x)

$\text{len}(\sigma)=360=45\times 2^3$

1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

|            |  0  | 17  | 20  | 21  |
|:----------:|:---:| --- | --- |:---:|
|            | 45  | 28  | 25  | 24  |
| column sum | 45  | 45  | 45  | 45  |

2. $n$ 整除 $a(1,1)$
$n=4 \ | \ 28$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=24=96/4=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=6, \ 3\ |\ 24-21$

```
def chip_firing_game(initial_state, firing_sequence):
    cube = list(initial_state)
    results = [cube.copy()]
    
    neighbors = {
        1: [2, 3, 5, 9],
        2: [1, 4, 6, 10],
        3: [1, 4, 7, 11],
        4: [2, 3, 8, 12],
        5: [1, 6, 7, 13],
        6: [2, 5, 8, 14],
        7: [3, 5, 8, 15],
        8: [4, 6, 7, 16],
        9: [1, 10, 11, 13],
        10: [2, 9, 12, 14],
        11: [3, 9, 12, 15],
        12: [4, 10, 11, 16],
        13: [5, 9, 14, 15],
        14: [6, 10, 13, 16],
        15: [7, 11, 13, 16],
        16: [8, 12, 14, 15]
    }
    
    for vertex in range(1, 17):
        for _ in range(firing_sequence[vertex-1]):
            cube[vertex-1] -= 4
            for neighbor in neighbors[vertex]:
                cube[neighbor-1] += 1
            results.append(cube.copy())
    
    return results

def print_cube_state(state):
    print(state)

initial_state = [-96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
firing_sequence = [0, 45, 17, 28, 17, 28, 20, 25, 17, 28,  20, 25, 20, 25, 21, 24]

results = chip_firing_game(initial_state, firing_sequence)

for i, state in enumerate(results):
    print(f"Step {i}:", end=" ")
    print_cube_state(state)
```

```
Step 0: [-96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 1: [-95, 92, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]
Step 2: [-94, 88, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0]
Step 3: [-93, 84, 0, 3, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0]
Step 4: [-92, 80, 0, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0]
Step 5: [-91, 76, 0, 5, 0, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0]
Step 6: [-90, 72, 0, 6, 0, 6, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0]
Step 7: [-89, 68, 0, 7, 0, 7, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0]
Step 8: [-88, 64, 0, 8, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0]
Step 9: [-87, 60, 0, 9, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0]
Step 10: [-86, 56, 0, 10, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0]
.
.
.
Step 352: [0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, -8, -8, 32]
Step 353: [0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, -7, -7, 28]
Step 354: [0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, -6, -6, 24]
Step 355: [0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, -5, -5, 20]
Step 356: [0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, -4, 0, -4, -4, 16]
Step 357: [0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, -3, 0, -3, -3, 12]
Step 358: [0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, -2, -2, 8]
Step 359: [0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, -1, -1, 4]
Step 360: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
```

---

### For 5-cube (N=960)

$\tilde{L}(Q_5)$:
![image](https://hackmd.io/_uploads/HknHsPkF0.png)

\begin{split}
    \tilde{L}^{-1}\begin{pmatrix} 960 \\ 0 \\ . \\ . \\. \\0  \end{pmatrix}= (&372, 147, 225, 147, 225, 170, 202, 147, 225, 170,\\ & 202, 170, 202, 177,195, 147, 225, 170, 202, 170,\\ & 202, 177, 195, 170, 202, 177, 195, 177, 195, 180, 192)^T
\end{split}

\begin{split}
   \Rightarrow  \sigma=(&0, 372, 147, 225, 147, 225, 170, 202, 147, 225, 170, 202, \\ &170,  202, 177,195, 147, 225, 170, 202, 170, 202, \\ & 177, 195, 170, 202, 177, 195, 177, 195, 180, 192) 
\end{split}

\begin{split}
    \Rightarrow  \ &v_3=v_5=v_9=v_{17}\\
&v_4=v_6=v_{10}=v_{18}\\
&v_7=v_{11}=v_{13}=v_{19}=v_{21}=v_{25}\\ 
&v_8=v_{12}=v_{14}=v_{20}=v_{22}=v_{26}\\ 
&v_{15}=v_{23}=v_{27}=v_{29}\\
&v_{16}=v_{24}=v_{28}=v_{30}
\end{split}

We only need to consider 10 vertices: $v_1, v_2, v_3, v_4, v_7, v_8, v_{15}, v_{16}, v_{31}, v_{32}$

$\text{len}(\sigma)=5952=372\times 2^4$

1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

|            |  0  | 147 | 170 | 177 | 180 |
|:----------:|:---:| --- | --- | --- |:---:|
|            | 372 | 225 | 202 | 195 | 192 |
| column sum | 372 | 372 | 372 | 372 | 372 |

2. $n$ 整除 $a(1,1)$
$n=5 \ | \ 225$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=192=960/5=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=12, \ 3\ |\ 12=192-180$

```
def chip_firing_game(initial_state, firing_sequence):
    cube = list(initial_state)
    results = [cube.copy()]
    
    neighbors = {
        1: [2, 3, 5, 9, 17],
        2: [1, 4, 6, 10, 18],
        3: [1, 4, 7, 11, 19],
        4: [2, 3, 8, 12, 20],
        5: [1, 6, 7, 13, 21],
        6: [2, 5, 8, 14, 22],
        7: [3, 5, 8, 15, 23],
        8: [4, 6, 7, 16, 24],
        9: [1, 10, 11, 13, 25],
        10: [2, 9, 12, 14, 26],
        11: [3, 9, 12, 15, 27],
        12: [4, 10, 11, 16, 28],
        13: [5, 9, 14, 15, 29],
        14: [6, 10, 13, 16, 30],
        15: [7, 11, 13, 16, 31],
        16: [8, 12, 14, 15, 32],
        17: [1, 18, 19, 21, 25],
        18: [2, 17, 20, 22, 26],
        19: [3, 17, 20, 23, 27],
        20: [4, 18, 19, 24, 28],
        21: [5, 17, 22, 23, 29],
        22: [6, 18, 21, 24, 30],
        23: [7, 19, 21, 24, 31],
        24: [8, 20, 22, 23, 32],
        25: [9, 17, 26, 27, 29],
        26: [10, 18, 25, 28, 30],
        27: [11, 19, 25, 28, 31],
        28: [12, 20, 26, 27, 32],
        29: [13, 21, 25, 30, 31],
        30: [14, 22, 26, 29, 32],
        31: [15, 23, 27, 29, 32],
        32: [16, 24, 28, 30, 31]
    }
    
    for vertex in range(1, 33):
        for _ in range(firing_sequence[vertex-1]):
            cube[vertex-1] -= 5
            for neighbor in neighbors[vertex]:
                cube[neighbor-1] += 1
            results.append(cube.copy())
    
    return results

def print_cube_state(state):
    print(state)

initial_state = [-960, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
firing_sequence = [0, 372, 147, 225, 147, 225, 170, 202, 147, 225, 170, 202, 170,  202, 177,195, 147, 225, 170, 202, 170, 202, 177, 195, 170, 202, 177, 195, 177, 195, 180, 192]

results = chip_firing_game(initial_state, firing_sequence)

# Print the first 10 states
for i in range(min(10, len(results))):
    print(f"Step {i}:", end=" ")
    print_cube_state(results[i])

# Print the last 10 states
if len(results) > 10:
    for i in range(-10, 0):
        print(f"Step {len(results) + i}:", end=" ")
        print_cube_state(results[i])
```

```
Step 0: [-960, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 1: [-959, 955, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 2: [-958, 950, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 3: [-957, 945, 0, 3, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 4: [-956, 940, 0, 4, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 5: [-955, 935, 0, 5, 0, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 6: [-954, 930, 0, 6, 0, 6, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 7: [-953, 925, 0, 7, 0, 7, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 8: [-952, 920, 0, 8, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Step 9: [-951, 915, 0, 9, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
.
.
.
Step 5943: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, -9, 0, -9, -9, 45]
Step 5944: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, -8, 0, -8, -8, 40]
Step 5945: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, 0, -7, -7, 35]
Step 5946: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, -6, 0, -6, -6, 30]
Step 5947: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, -5, 0, -5, -5, 25]
Step 5948: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0, -4, 0, -4, -4, 20]
Step 5949: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, -3, 0, -3, -3, 15]
Step 5950: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, -2, 0, -2, -2, 10]
Step 5951: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, -1, -1, 5]
Step 5952: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
```



---

### For 6-cube (N=960)

\begin{split}
    \tilde{L}(Q_6)^{-1}\begin{pmatrix} 960 \\ 0 \\ . \\ . \\. \\0  \end{pmatrix}= (&315, 129, 186, 129, 186, 147, 168, 129, 186, \\&147, 168, 147, 168, 152, 163, 129, 186, 147, \\&168, 147, 168, 152, 163, 147, 168, 152, 163, \\&152, 163, 154, 161, 129, 186, 147, 168, 147, \\&168, 152, 163, 147, 168, 152, 163, 152, 163,\\&154, 161, 147, 168, 152, 163, 152, 163, 154, \\&161, 152, 163, 154, 161, 154, 161, 155, 160)^T
\end{split}

\begin{split}
   \Rightarrow  \sigma=(&0, 315, 129, 186, 129, 186, 147, 168, 129, 186, \\&147, 168, 147, 168, 152, 163, 129, 186, 147, \\&168, 147, 168, 152, 163, 147, 168, 152, 163, \\&152, 163, 154, 161, 129, 186, 147, 168, 147, \\&168, 152, 163, 147, 168, 152, 163, 152, 163,\\&154, 161, 147, 168, 152, 163, 152, 163, 154, \\&161, 152, 163, 154, 161, 154, 161, 155, 160) 
\end{split}

\begin{split}
    \Rightarrow  \ &v_3=v_5=v_9=v_{17}=v_{33}\\
&v_4=v_6=v_{10}=v_{18}=v_{34}\\
&v_7=v_{11}=v_{13}=v_{19}=v_{21}=v_{25}=v_{35}=v_{37}=v_{41}=v_{49}\\ 
&v_8=v_{12}=v_{14}=v_{20}=v_{22}=v_{26}=v_{36}=v_{38}=v_{42}=v_{50}\\ 
&v_{15}=v_{23}=v_{27}=v_{29}=v_{39}=v_{43}=v_{45}=v_{51}=v_{53}=v_{57}\\
&v_{16}=v_{24}=v_{28}=v_{30}=v_{40}=v_{44}=v_{46}=v_{52}=v_{54}=v_{58}\\
&v_{31}=v_{47}=v_{55}=v_{59}=v_{61}\\
&v_{32}=v_{48}=v_{56}=v_{60}=v_{62}
\end{split}

We only need to consider 12 vertices: $v_1, v_2, v_3, v_4, v_7, v_8, v_{15}, v_{16}, v_{31}, v_{32}, v_{63}, v_{64}$

$\text{len}(\sigma)=10080=315\times 2^5$

1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

|            |  0  | 129 | 147 | 152 | 154 | 155 |
|:----------:|:---:| --- | --- | --- | --- |:---:|
|            | 315 | 186 | 168 | 163 | 161 | 160 |
| column sum | 315 | 315 | 315 | 315 | 315 | 315 |

2. $n$ 整除 $a(1,1)$
$n=6 \ | \ 186$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=160=960/6=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=20, \ 5\ |\ 5=160-155$

---

### For 7-cube (N=13440)

\begin{split}
    \tilde{L}(Q_7)^{-1}\begin{pmatrix} 13440 \\ 0 \\ . \\ . \\. \\0  \end{pmatrix}= (&3810, 1605, 2205, 1605, 2205, 1806, 2004, 1605, 2205, 1806, \\&2004, 1806, 2004, 1857, 1953, 1605, 2205, 1806, 2004, 1806, \\&2004, 1857, 1953, 1806, 2004, 1857, 1953, 1857, 1953, 1876, \\&1934, 1605, 2205, 1806, 2004, 1806, 2004, 1857, 1953, 1806, \\&2004, 1857, 1953, 1857, 1953, 1876, 1934, 1806, 2004, 1857, \\&1953, 1857, 1953, 1876, 1934, 1857, 1953, 1876, 1934, 1876, \\&1934, 1885, 1925, 1605, 2205, 1806, 2004, 1806, 2004, 1857, \\&1953, 1806, 2004, 1857, 1953, 1857, 1953, 1876, 1934, 1806, \\&2004, 1857, 1953, 1857, 1953, 1876, 1934, 1857, 1953, 1876, \\&1934, 1876, 1934, 1885, 1925, 1806, 2004, 1857, 1953, 1857, \\&1953, 1876, 1934, 1857, 1953, 1876, 1934, 1876, 1934, 1885, \\&1925, 1857, 1953, 1876, 1934, 1876, 1934, 1885, 1925, 1876, \\&1934, 1885, 1925, 1885, 1925, 1890, 1920)^T
\end{split}

\begin{split}
   \Rightarrow  \sigma=(&0, 3810, 1605, 2205, 1605, 2205, 1806, 2004, 1605, 2205, 1806, \\&2004, 1806, 2004, 1857, 1953, 1605, 2205, 1806, 2004, 1806, \\&2004, 1857, 1953, 1806, 2004, 1857, 1953, 1857, 1953, 1876, \\&1934, 1605, 2205, 1806, 2004, 1806, 2004, 1857, 1953, 1806, \\&2004, 1857, 1953, 1857, 1953, 1876, 1934, 1806, 2004, 1857, \\&1953, 1857, 1953, 1876, 1934, 1857, 1953, 1876, 1934, 1876, \\&1934, 1885, 1925, 1605, 2205, 1806, 2004, 1806, 2004, 1857, \\&1953, 1806, 2004, 1857, 1953, 1857, 1953, 1876, 1934, 1806, \\&2004, 1857, 1953, 1857, 1953, 1876, 1934, 1857, 1953, 1876, \\&1934, 1876, 1934, 1885, 1925, 1806, 2004, 1857, 1953, 1857, \\&1953, 1876, 1934, 1857, 1953, 1876, 1934, 1876, 1934, 1885, \\&1925, 1857, 1953, 1876, 1934, 1876, 1934, 1885, 1925, 1876, \\&1934, 1885, 1925, 1885, 1925, 1890, 1920) 
\end{split}

\begin{split}
\Rightarrow \ &v_3=v_5=v_9=v_{17}=v_{33}=v_{65}\\
&v_4=v_6=v_{10}=v_{18}=v_{34}=v_{66}\\
&v_7=v_{11}=v_{13}=v_{19}=v_{21}=v_{25}=v_{35}=v_{37}=v_{41}=v_{49}=v_{67}=v_{69}=v_{73}=v_{81}=v_{97}\\
&v_8=v_{12}=v_{14}=v_{20}=v_{22}=v_{26}=v_{36}=v_{38}=v_{42}=v_{50}=v_{68}=v_{70}=v_{74}=v_{82}=v_{98}\\ 
&v_{15}=v_{23}=v_{27}=v_{29}=v_{39}=v_{43}=v_{45}=v_{51}=v_{53}=v_{57}=v_{71}=v_{75}=v_{77}=v_{83}=v_{85}=v_{89}=v_{99}=v_{101}=v_{105}=v_{113}\\
&v_{16}=v_{24}=v_{28}=v_{30}=v_{40}=v_{44}=v_{46}=v_{52}=v_{54}=v_{58}=v_{72}=v_{76}=v_{78}=v_{84}=v_{86}=v_{90}=v_{100}=v_{102}=v_{106}=v_{114}\\
&v_{31}=v_{47}=v_{55}=v_{59}=v_{61}=v_{79}=v_{87}=v_{91}=v_{93}=v_{103}=v_{107}=v_{109}=v_{115}=v_{117}=v_{121}\\
&v_{32}=v_{48}=v_{56}=v_{60}=v_{62}=v_{80}=v_{88}=v_{92}=v_{94}=v_{104}=v_{108}=v_{110}=v_{116}=v_{118}=v_{122}\\
&v_{63}=v_{95}=v_{111}=v_{119}=v_{123}=v_{125}\\
&v_{64}=v_{96}=v_{112}=v_{120}=v_{124}=v_{126}
\end{split}

We only need to consider 14 vertices: $v_1, v_2, v_3, v_4, v_7, v_8, v_{15}, v_{16}, v_{31}, v_{32}, v_{63}, v_{64}, v_{127}, v_{128}$


$\text{len}(\sigma)=243840=3810\times 2^6$

1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

|            |  0   | 1605 | 1806 | 1857 | 1876 | 1885 | 1890 |
|:----------:|:----:|:----:| ---- | ---- | ---- | ---- |:----:|
|            | 3810 | 2205 | 2004 | 1953 | 1934 | 1925 | 1920 |
| column sum | 3810 | 3810 | 3810 | 3810 | 3810 | 3810 | 3810 |

2. $n$ 整除 $a(1,1)$
$n=7 \ | \ 2205$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=1920=13440/7=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=30, \ 3\ |\ 30=1920-1890, \ 5\ |\ 30, \ 15\ |\ 30$

---
### For 8-cube (N=107520)

Compute $\tilde{L}(Q_8)^{-1}\begin{pmatrix} 107520 \\ 0 \\ . \\ . \\. \\0  \end{pmatrix}$, we get $\sigma=$ 
(由左到右，由上到下依序為 $\sigma_{(1)}, \sigma_{(2)}, \cdots, \sigma_{(256)}$)
![image](https://hackmd.io/_uploads/ryglZxMFA.png)

\begin{split}
\Rightarrow \ &v_{3}=v_{5}=v_{9}=v_{17}=v_{33}=v_{65}=v_{129}\\ 
&v_{4}=v_{6}=v_{10}=v_{18}=v_{34}=v_{66}=v_{130}\\
&v_{7}=v_{11}=v_{13}=v_{19}=v_{21}=v_{25}=v_{35}=v_{37}=v_{41}=v_{49}=v_{67}=v_{69}=v_{73}=v_{81}=v_{97}=v_{131}=v_{133}=v_{137}=v_{145}=v_{161}=v_{193}\\
&v_{8}=v_{12}=v_{14}=v_{20}=v_{22}=v_{26}=v_{36}=v_{38}=v_{42}=v_{50}=v_{68}=v_{70}=v_{74}=v_{82}=v_{98}=v_{132}=v_{134}=v_{138}=v_{146}=v_{162}=v_{194}\\ 
&v_{15}=v_{23}=v_{27}=v_{29}=v_{39}=v_{43}=v_{45}=v_{51}=v_{53}=v_{57}=v_{71}=v_{75}=v_{77}=v_{83}=v_{85}=v_{89}=v_{99}=v_{101}=v_{105}=v_{113}=v_{135}=v_{139}=v_{141}=v_{147}=v_{149}=v_{153}=v_{163}=v_{165}=v_{169}=v_{177}=v_{195}=v_{197}=v_{201}=v_{209}=v_{225}\\
&v_{16}=v_{24}=v_{28}=v_{30}=v_{40}=v_{44}=v_{46}=v_{52}=v_{54}=v_{58}=v_{72}=v_{76}=v_{78}=v_{84}=v_{86}=v_{90}=v_{100}=v_{102}=v_{106}=v_{114}=v_{136}=v_{140}=v_{142}=v_{148}=v_{150}=v_{154}=v_{164}=v_{166}=v_{170}=v_{178}=v_{196}=v_{198}=v_{202}=v_{210}=v_{226}\\
&v_{31}=v_{47}=v_{55}=v_{59}=v_{61}=v_{79}=v_{87}=v_{91}=v_{93}=v_{103}=v_{107}=v_{109}=v_{115}=v_{117}=v_{121}=v_{143}=v_{151}=v_{155}=v_{157}=v_{167}=v_{171}=v_{173}=v_{179}=v_{181}=v_{185}=v_{199}=v_{203}=v_{205}=v_{211}=v_{213}=v_{217}=v_{227}=v_{229}=v_{233}=v_{241}\\
&v_{32}=v_{48}=v_{56}=v_{60}=v_{62}=v_{80}=v_{88}=v_{92}=v_{94}=v_{104}=v_{108}=v_{110}=v_{116}=v_{118}=v_{122}=v_{144}=v_{152}=v_{156}=v_{158}=v_{168}=v_{172}=v_{174}=v_{180}=v_{182}=v_{186}=v_{200}=v_{204}=v_{206}=v_{212}=v_{214}=v_{218}=v_{228}=v_{230}=v_{234}=v_{242}\\
&v_{63}=v_{95}=v_{111}=v_{119}=v_{123}=v_{125}=v_{159}=v_{175}=v_{183}=v_{187}=v_{189}=v_{207}=v_{215}=v_{219}=v_{221}=v_{231}=v_{235}=v_{237}=v_{243}=v_{245}=v_{249}\\
&v_{64}=v_{96}=v_{112}=v_{120}=v_{124}=v_{126}=v_{160}=v_{176}=v_{184}=v_{188}=v_{190}=v_{208}=v_{216}=v_{220}=v_{222}=v_{232}=v_{236}=v_{238}=v_{244}=v_{246}=v_{250}\\
&v_{127}=v_{191}=v_{223}=v_{239}=v_{247}=v_{251}=v_{253}\\
&v_{128}=v_{192}=v_{224}=v_{240}=v_{248}=v_{252}=v_{254}
\end{split}

We only need to consider 16 vertices: $v_1, v_2, v_3, v_4, v_7, v_8, v_{15}, v_{16}, v_{31}, v_{32}, v_{63}, v_{64}, v_{127}, v_{128}, v_{255}, v_{256}$

$\text{len}(\sigma)=3427200=26775\times 2^7$

1. 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數

|            |   0   | 11535 | 12840 | 13143 | 13248 | 13295 | 13320 | 13335 |
|:----------:|:-----:|:-----:| ----- | ----- |:-----:| ----- |:-----:|:-----:|
|            | 26775 | 15240 | 13935 | 13632 | 13527 | 13480 | 13455 | 13440 |
| column sum | 26775 | 26775 | 26775 | 26775 | 26775 | 26775 | 26775 | 26775 |

2. $n$ 整除 $a(1,1)$
$n=8 \ | \ 15240$

3. $a(1,n-1)=\text{max order}/n$
$a(1,n-1)=13440=107520/8=\text{max order}/n$

4. $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$
$(n-1)(n-2)=42, \ 3\ |\ 105, \ 7\ |\ 105, \ 21\ |\ 105$

---
## Prime Factorization

### 2-cube 
$[0, 3, 1, 2]$

$3=3$
$1=1$
$2=2$

### 3-cube 
$[0, 14, 5, 9, 6, 8]$

$14=2\times 7$
$5=5$
$9=3^2$
$6=2 \times 3$
$8=2^3$

### 4-cube
$[0, 45, 17, 28, 20, 25, 21, 24]$

$45=3^2 \times 5$
$17=17$
$28=2^2 \times 7$
$20=2^2 \times 5$
$25=5^2$
$21=3 \times 7$
$24=2^3 \times 3$

### 5-cube 
$[0, 372, 147, 225, 170, 202, 177, 195, 180, 192]$

$372=2^2 \times 3 \times 31$
$147=3 \times 7^2$
$225=3^2 \times 5^2$
$170=2 \times 5 \times 17$
$202=2 \times 101$
$177=3 \times 59$
$195=3 \times 5 \times 13$
$180=2^2 \times 3^2 \times 5$
$192=2^6 \times 3$

### 6-cube 
$[0, 315, 129, 186, 147, 168, 152, 163, 154, 161, 155, 160]$

$315=3^2 \times 5 \times 7$
$129=3 \times 43$
$186=2 \times 3 \times 31$
$147=3 \times 7^2$
$168=2^3 \times 3 \times 7$
$152=2^3 \times 19$
$163=163$
$154=2 \times 7 \times 11$
$161=7 \times 23$
$155=5 \times 31$
$160=2^5 \times 5$

### 7-cube 
$[0, 3810, 1605, 2205, 1806, 2004, 1857, 1953, 1876, 1934, 1885, 1925, 1890, 1920]$


$3810=2 \times 3 \times 5 \times 127$
$1605=3 \times 5 \times 107$
$2205=3^2 \times 5 \times 7^2$
$1806=2 \times 3 \times 7 \times 43$
$2004=2^2 \times 3 \times 167$
$1857=3 \times 619$
$1953=3^2 \times 7 \times 31$
$1876=2^2 \times 7 \times 67$
$1934=2 \times 967$
$1885=5 \times 13 \times 29$
$1925=5^2 \times 7 \times 11$
$1890=2 \times 3^3 \times 5 \times 7$
$1920=2^7 \times 3 \times 5$

### 8-cube
$[0, 26775, 11535, 15240, 12840, 13935, 13143, 13632, 13248, 13527,  13295, 13480, 13320, 13455, 13335, 13440]$

$26775=3^2 \times 5^2 \times 7 \times 17$
$11535=3 \times 5 \times 769$
$15240=2^3 \times 3 \times 5 \times 127$
$12840=2^3 \times 3 \times 5 \times 107$
$13935=3 \times 5 \times 929$
$13143=3 \times 13 \times 337$
$13632=2^6 \times 3 \times 71$
$13248=2^6 \times 3^2 \times 23$
$13527=3^4 \times 167$
$13295=5 \times 2659$
$13480=2^3 \times 5 \times 337$
$13320=2^3 \times 3^2 \times 5 \times 37$
$13455=3^2 \times 5 \times 13 \times 23$
$13335=3 \times 5 \times 7 \times 127$
$13440=2^7 \times 3 \times 5 \times 7$



---

## Observation

* For $n$-cube, we may only consider its $2n$ vertices, which are: $$v_1, v_2, v_3, v_4, v_7, v_8, v_{15}, v_{16},\cdots, v_{2^n-1}, v_{2^n}$$


* $\text{len}(\sigma)= \sigma_{(2)} \times 2^{n-1}\quad$ ( 總發射次數 $=v_2$ 發射次數 $\times  2^{n-1}$ )
    If we find a way to get $\text{len}(\sigma)$, then we could immediately know how many times should $v_2$ fires, which has $N$ sands initially. 
In other words, if we find a way to get $\sigma_{(2)}$, then we could immediately know $\text{len}(\sigma)$, that is, how many times should we fire to get zero configuration.
    > 2-cube：$\text{len}(\sigma)= 3 \times 2^{1}\quad$ 
    > 3-cube：$\text{len}(\sigma)= 14 \times 2^{2}\quad$ 
    > 4-cube：$\text{len}(\sigma)= 45 \times 2^{3}\quad$ 
    > 5-cube：$\text{len}(\sigma)= 372 \times 2^{4}\quad$ 
    > 6-cube：$\text{len}(\sigma)= 315 \times 2^{5}\quad$ 
    > 7-cube：$\text{len}(\sigma)= 3810 \times 2^{6}\quad$ 
    > 8-cube：$\text{len}(\sigma)= 26775 \times 2^{7}\quad$ 


* 把 $2n$ 個數排成 $2\times n$ 表格的話每列的和$(a(0,i)+a(1,i))$是常數
    2-cube：
    | $\sigma_{(1)}, \sigma_{(3)}$ |  0  |  1  |
    |:----------------------------:|:---:|:---:|
    | $\sigma_{(2)}, \sigma_{(4)}$ |  3  |  2  |
    |          column sum          |  3  |  3  |
    
    3-cube：
    |            |  0  | 5   |  6  |
    |:----------:|:---:| --- |:---:|
    |            | 14  | 9   |  8  |
    | column sum | 14  | 14  | 14  |
    
    4-cube：
    |            |  0  | 17  | 20  | 21  |
    |:----------:|:---:| --- | --- |:---:|
    |            | 45  | 28  | 25  | 24  |
    | column sum | 45  | 45  | 45  | 45  |
    
    5-cube：
    |            |  0  | 147 | 170 | 177 | 180 |
    |:----------:|:---:| --- | --- | --- |:---:|
    |            | 372 | 225 | 202 | 195 | 192 |
    | column sum | 372 | 372 | 372 | 372 | 372 |
    
    6-cube：
    |            |  0  | 129 | 147 | 152 | 154 | 155 |
    |:----------:|:---:| --- | --- | --- | --- |:---:|
    |            | 315 | 186 | 168 | 163 | 161 | 160 |
    | column sum | 315 | 315 | 315 | 315 | 315 | 315 |
    
    7-cube：
    |            |  0   | 1605 | 1806 | 1857 | 1876 | 1885 | 1890 |
    |:----------:|:----:|:----:| ---- | ---- | ---- | ---- |:----:|
    |            | 3810 | 2205 | 2004 | 1953 | 1934 | 1925 | 1920 |
    | column sum | 3810 | 3810 | 3810 | 3810 | 3810 | 3810 | 3810 |
    
    8-cube：
    |            |   0   | 11535 | 12840 | 13143 | 13248 | 13295 | 13320 | 13335 |
    |:----------:|:-----:|:-----:| ----- | ----- |:-----:| ----- |:-----:|:-----:|
    |            | 26775 | 15240 | 13935 | 13632 | 13527 | 13480 | 13455 | 13440 |
    | column sum | 26775 | 26775 | 26775 | 26775 | 26775 | 26775 | 26775 | 26775 |


* $n$ 整除 $a(1,1)$
    2-cube：$n=2 \ | \ 2$，quotient $=1$

    3-cube：$n=3 \ | \ 9$，quotient $=3$

    4-cube：$n=4 \ | \ 28$，quotient $=7$

    5-cube：$n=5 \ | \ 225$，quotient $=45$

    6-cube：$n=6 \ | \ 186$，quotient $=31$

    7-cube：$n=7 \ | \ 2205$，quotient $=315$

    8-cube：$n=8 \ | \ 15240$，quotient $=1905$
    
    ==The quotient divides $a(0, n-1)$ (upper right corner of the table) and $$\text{upper right corner } \div \text{ quotient }= n-1$$ In other words, $$a(0, n-1) \div (a(1, 1) \div n) = n-1$$$$\Rightarrow a(0, n-1)=\dfrac{n-1}{n}a(1, 1)$$==


* $(n-1)(n-2)$ 的odd factor整除 $a(1,n-1)-a(0,n-1)$

    2-cube：$(n-1)(n-2)=0$

    3-cube：$(n-1)(n-2)=2, \ 2\ |\ 8-6$

    4-cube：$(n-1)(n-2)=6, \ 3\ |\ 24-21$

    5-cube：$(n-1)(n-2)=12, \ 3\ |\ 12=192-180$

    6-cube：$(n-1)(n-2)=20, \ 5\ |\ 5=160-155$

    7-cube：$(n-1)(n-2)=30, \ 3\ |\ 30=1920-1890, \ 5\ |\ 30, \ 15\ |\ 30$

    8-cube：$(n-1)(n-2)=42, \ 3\ |\ 105, \ 7\ |\ 105, \ 21\ |\ 105$

* $a(0,n-1; n) = \dfrac{(n-1)a(1,0; n-1)}{c(n)}$, 其中 $c(n)$ 是一個「很小」的整數。

    $n=3$ ： $c(3)=1$
    
    $n=4$ ： $c(4)=2$
    
    $n=5$ ： $c(5)=1$
    
    $n=6$ ： $c(6)=12$
    
    $n=7$ ： $c(7)=1$
    
    $n=8$ ： $c(8)=2$
    
    $n=9$ ： $c(9)=3$
    
    $n=10$ ： $c(10)=20$
    
    $n=11$ ： $c(11)=2$
    
    $n=12$ ： $c(12)=6$
    
    $n=13$ ： $c(13)=1$
    
    
    
    
* $a(1,n-1)=\text{max order}/n$

    2-cube：$2=4/2$

    3-cube：$8=24/3$

    4-cube：$24=96/4$

    5-cube：$192=960/5$

    6-cube：$160=960/6$

    7-cube：$1920=13440/7$

    8-cube：$13440=107520/8$
    
    ![L-17 (1)](https://hackmd.io/_uploads/rJxu9UGL5R.jpg)

    ![L-18 (1)](https://hackmd.io/_uploads/Hy6qAf89C.jpg)



    e.g. for $n=5$, we want to prove the following two matrices have the same determinant.
    $$\begin{pmatrix}
5 & 0 & -4 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 20 & -4 & -12 & 0 & 0 & 0 & 0 & 0 \\
-4 & -4 & 20 & 0 & -12 & 0 & 0 & 0 & 0 \\
0 & -12 & 0 & 30 & -6 & -12 & 0 & 0 & 0 \\
0 & 0 & -12 & -6 & 30 & 0 & -12 & 0 & 0 \\
0 & 0 & 0 & -12 & 0 & 20 & -4 & -4 & 0 \\
0 & 0 & 0 & 0 & -12 & -4 & 20 & 0 & -4 \\
0 & 0 & 0 & 0 & 0 & -4 & 0 & 5 & -1 \\
0 & 0 & 0 & 0 & 0 & 0 & -4 & -1 & 5
\end{pmatrix}\quad \begin{pmatrix}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 5 \\
0 & 20 & -4 & -12 & 0 & 0 & 0 & 0 & 0 \\
-4 & -4 & 20 & 0 & -12 & 0 & 0 & 0 & 0 \\
0 & -12 & 0 & 30 & -6 & -12 & 0 & 0 & 0 \\
0 & 0 & -12 & -6 & 30 & 0 & -12 & 0 & 0 \\
0 & 0 & 0 & -12 & 0 & 20 & -4 & -4 & 0 \\
0 & 0 & 0 & 0 & -12 & -4 & 20 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & -4 & 0 & 5 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & -4 & -1 & 0
\end{pmatrix}$$
    
    * adding a scalar multiple of a row/column to another row/column.
    * eigenvalue   
    * characteristic polynomial
    * row echelon form
    * cofactor expansion
    * find $C \in \text{SL}(2n-1, \mathbb{R})$ with $A=BC$



---
