Let $q = p^s$ and $r = q^m$, where $p$ is a prime, $s$ and $m$ are positive integers. Let $N>1$ be an integer dividing $r - 1$, and put $n = (r - 1)/N$.


Let $\alpha$ be a primitive element of $\mathbb{F}\_r$, $\theta = \alpha^N$, and $Tr\_{r/q}$ be the trace function from $\mathbb{F}\_r$ to $\mathbb{F}\_q$. The set


$$C(r,N) = \{ (Tr\_{r/q}(\beta), Tr\_{r/q} (\beta \theta),\dots, Tr\_{r/q}(\beta \theta^{n-1})) : \beta \in \mathbb{F}\_r\}$$


is an irreducible cyclice code of length $n$ over $\mathbb{F}\_q$.


Let's define the set


$$Z(r,a) = \#\{x \in \mathbb{F}\_r: \text{Tr}\_{r/q}(x) = 0 \}.$$


The paper "The weight distribution of some irreducible cyclic codes" by Cunsheng Ding makes the following statement:



> 
> Hence, for any $\beta \in \mathbb{F}\_r^\*$ the Hamming weight of the codeword
> 
> 
> $$c(\beta) = (Tr\_{r/q}(\beta), Tr\_{r/q} (\beta \theta),\dots, Tr\_{r/q}(\beta \theta^{n-1}))$$
> 
> 
> of the code $C(r,N)$ is equal to
> 
> 
> $$n - \frac{Z(r, \beta) - 1}{N}.$$
> 
> 
> 


Can anyone provide any proof for this statement?



Weight of a codeword in a cyclic code as a function of the number of solutions of an equation involving the trace function
The codeword $c(\beta)$ in your question is defined on a set via the trace map that does not include the zero element. Thus its number of nonzero elements is simply the length *minus* the number of $k\in \{0,1,\ldots,n-1\}$ which give $Tr(\beta \theta^k)=0.$


From the equidistribution properties of the trace function and the fact that we are considering a subfield of index $N$ the number of zeroes of the trace function *minus* 1, in the extension field, needs to be divided by $N$ when projected into the subfield.


