6. For $a \in[1,2019]$, define the sequence $\left\{x_{n}\right\}$ $(n \geqslant 0): x_{0}=a$, for each non-negative integer $n$,
$$
x_{n+1}=\left\{\begin{array}{ll}
1+1009 x_{n}, & x_{n} \leqslant 2 ; \\
2021-x_{n}, & 21011 .
\end{array}\right.
$$

If there exists a positive integer $k$, such that $x_{k}=a$, then the smallest positive integer among such positive integers $k$ is called the smallest positive period of the sequence $\left\{x_{n}\right\}$ $(n \geqslant 0)$. Find all possible smallest positive periods of the sequence $\left\{x_{n}\right\}(n \geqslant 0)$, and find the value of $a$ when the smallest positive period is the smallest odd number greater than 1.
6. Define the function:
$$
f(x)=\left\{\begin{array}{ll}
1+1009 x, & x \leqslant 2 ; \\
2021-x, & 21011 .
\end{array}\right.
$$

Then $x_{n+1}=f\left(x_{n}\right)(n=0,1, \cdots)$.
Since $f:[1,2019] \rightarrow[1,2019]$, for any $a \in[1,2019]$, we know that for all non-negative integers $n$, $x_{n} \in[1,2019]$.
Let the set $S=\{1,2, \cdots, 2018\}$.
For each $k \in S$, define $I_{k}=[k, k+1]$, then $f$ maps $I_{1}$ to $\bigcup_{i=1}^{2010} I_{i}$, maps $I_{1010}$ to $I_{1009} \cup I_{1010}$, maps $I_{1009}$ to $I_{1011}$, maps $I_{1011}$ to $I_{1008}$, maps $I_{1008}$ to $I_{1012}, \cdots \cdots$ maps $I_{2}$ to $I_{2018}$, and maps $I_{2018}$ to $I_{1}$, as shown in Figure 3.
Define: $f^{(1)}(x)=f(x)$,
$$
f^{(m)}(x)=f^{(m-1)}(x)(m=2,3, \cdots) \text {. }
$$

Then for any positive integer $n, x_{n}=f^{(n)}(a)$.
If $n$ is the smallest positive period of the sequence $\left\{x_{n}\right\}(n \geqslant 0)$, then $f^{(n)}(a)=a$.

Assume $a \in I_{k_{0}}, k_{0} \in S$, for $r \in\{1,2, \cdots, n\}$, denote $f^{(r)}(a) \in I_{k_{r}}, k_{r} \in S$.
Then in Figure 3, we can obtain a cycle of length $n$:
$$
I_{k_{0}} \rightarrow I_{k_{1}} \rightarrow \cdots \rightarrow I_{k_{n}}=I_{k_{0}} .
$$

From Figure 3, we know that there are no cycles of length $3,5, \cdots, 2017$, and there exists a unique cycle of length 2019:
$$
\begin{array}{l}
I_{1010} \rightarrow I_{1010} \rightarrow I_{1009} \rightarrow I_{1011} \rightarrow I_{1008} \rightarrow \cdots \\
\rightarrow I_{2} \rightarrow I_{2018} \rightarrow I_{1} \rightarrow I_{1010} .
\end{array}
$$

For any integer $a \in[1,2019]$, we know that the smallest positive period of the sequence $\left\{x_{n}\right\}(n \geqslant 0)$ with $x_{0}=a$ is 2019. Thus, 2019 is the smallest positive period greater than 1 and is an odd number.

By Sharkovsky's theorem, we know that all positive even numbers are the smallest positive periods of this sequence, all positive odd numbers not less than 2019 and $1\left(a=\frac{3031}{3}\right)$ are the smallest positive periods of this sequence.

For the cycle (2), let $a_{0} \in I_{1010}$ be the initial condition corresponding to this cycle. Then
$$
\begin{array}{l}
a_{0} \in I_{1010}, f\left(a_{0}\right) \in I_{1010}, \\
f^{(2)}\left(a_{0}\right) \in I_{1009}, \cdots, \\
f^{(2018)}\left(a_{0}\right) \in I_{1}, f^{(2019)}\left(a_{0}\right) \in I_{1010} .
\end{array}
$$

Let $a_{0}=1010+t(t \in[0,1])$.
Since each arrow in cycle (2) is determined by the function in (1), we have
$$
\begin{array}{l}
f\left(a_{0}\right)=1011-2 t, \\
f^{(2)}\left(a_{0}\right)=1009+4 t, \\
\cdots \cdots . \\
f^{(2018)}\left(a_{0}\right)=1+4 t, \\
f^{(2019)}\left(a_{0}\right)=1010+4036 t .
\end{array}
$$

Since $1010+4036 t=a_{0}=1010+t$, we have $t=0, a_{0}=1010$.
Thus, for other initial conditions in the unique cycle (2) with a period of 2019, 1010 will also appear.
Since only when $x$ is an integer,
$$
f(x) \in\{1,2, \cdots, 2019\},
$$

the initial conditions that make the sequence $\left\{x_{n}\right\}(n \geqslant 0)$ have a smallest positive period of 2019 must be integers from 1 to 2019.