1. Given a non-constant sequence $\left\{a_{i}\right\}$, satisfying $a_{i+1}^{2}-a_{i} a_{i+1}+a_{i}^{2}=0$, and $a_{i+1} \neq a_{i-1}, i=1$, $2,3, \cdots, n$. For a given positive integer $n, a_{1}=a_{n+1}=1, \sum_{i=0}^{n-1} a_{i}$ equals $(\quad)$.
A. 2
B. -1
C. 1
D. 0
1. D.
$a_{i+1}^{2}-a_{i} a_{i+1}+a_{i}^{2}=0$, and $a_{i}^{2}-a_{i-1} a_{i}+a_{i-1}^{2}=0$, subtracting the two equations gives $a_{i+1}^{2}-a_{i-1}^{2}+a_{i-1} a_{i}-a_{i} a_{i+1}=0$. Since $a_{i+1} \neq a_{i-1}$, we have $a_{i+1}+a_{i-1}=a_{i}(i=1,2, \cdots, n)$. Therefore, $a_{0}=a_{1}-a_{2}, a_{1}=a_{2}-a_{3}$, $\cdots, a_{n-2}=a_{n-1}-a_{n}, a_{n-1}=a_{n}-a_{n+1}$, summing these up gives $\sum_{i=0}^{n-1} a_{i}=a_{1}-a_{n+1}=0$.