Let $q=3^m$
with $m$
odd and let $s\geq 1$
. We determine exactly the number of roots in $\mathbb {F}_q$
of $ x^{3^s+1}-x^2+1=0. $
This equation appears in the study of open problems of Ding and Helleseth [‘Optimal ternary cyclic codes from monomials’, IEEE Trans. Inform. Theory 59(9) (2013), 5898–5904]. A Cayley transform sends the equation to the norm-one subgroup of $\mathbb {F}_{q^2}^{\times }$
, where the question becomes a calculation in a cyclic group. We prove that $ \#\{x\in \mathbb {F}_q:x^{3^s+1}-x^2+1=0\} = \gcd \, (3^m+1,\,3^s+2(-1)^s)-1. $
Consequently, the corresponding no-root condition is equivalent to $ \gcd \, (3^m+1,\,3^s+2(-1)^s)=1. $
As an application, we settle in the negative a conjectural no-root statement from the cyclic-code literature, by giving infinitely many pairs $(m,s)$
satisfying the proposed hypotheses for which the equation has roots.