$[q+1,2,q]$ $q$-ary cyclic code. Show that $q$ is even $[q+1,2,q]$ is a $q$-ary cyclic code $C$. Show that $q$ is even.
I tried to prove that if $q$ is odd, then $[q+1,2,q]$ is not a $q$-ary cyclic code.
Every non-zero codeword of $C$ has exactly one zero entry. 
c=$(c_{0},c_{1},\cdots,c_{q})$ is a word in $C$. If $c_{0}=c_{(q+1)/2}=1$ then there can be only one codeword with $c_{0}=c_{(q+1)/2}=1$ , otherwise we are losing the third parameter. If $C$ were cyclic, then a cyclic shift of $(q+1)/2$ positions will give again $c_{0}=c_{(q+1)/2}=1$, but this is not possible. So $q$ must be even number. 
My question is: How can I prove that the code must have a codeword $c_{0}=c_{(q+1)/2}=1$? Why must c with $c_{0}=c_{(q+1)/2}=1$ be a part of the code? 
 A: A $[q+1,2,q]$ code over $\mathbb F_q$ is a maximum-distance-separable (MDS) code which is also known as a doubly-extended Reed-Solomon code. Such a code can be arranged to be a cyclic code if we can find a parity-check polynomial $h(x)$ of degree $2$ in $\mathbb F_q[x]$ such that $h(x)$ is a divisor of $x^{q+1}-1$ and its two roots are successive powers of $\alpha$, an element of multiplicative order $q+1$ in $F_{q^2}$.  The roots must be conjugate elements $\beta=\alpha^i$ and $\beta^q = \alpha^{qi}$ too so that $h(x)$ is in $\mathbb F_q[x]$. Now, note that $\beta\cdot \beta^{q} = \beta^{q+1} = 1$ and so the conjugates $\beta$ and $\beta^q$ are inverses of each other. Now, show that if $q$ is odd, then $\beta^q$ equals$-\beta$ and so $\beta$ and $\beta_q$ cannot be successive powers of $\alpha$ (both $\alpha^0 = 1$ and $\alpha^{\frac{q+1}{2}}=-1$ lie between them in the list of successive powers of $\alpha$), while if $q$ is even, then the conjugate of $\beta =\alpha^{\frac q2}$ is 
$$\beta^q = \alpha^{\frac{q^2}{2}}
= \alpha^{\left.\left.\frac q2\right(q+1\right)-\frac q2} = 1^{\frac q2}\cdot\alpha^{-\frac q2} = \alpha^{q+1 -\frac q2} = \alpha^ {\frac q2 + 1}$$ and so $\beta =\alpha^{\frac q2}$ and $\beta^q = \alpha^ {\frac q2 + 1}$ ae indeed two successive powers of $\alpha$ as we need them to be. 
