Here it is proved that a cyclic (n, k) code over GF(q) is equidistant if and only if its parity check polynomial is irreducible and has exponent where a divides q − 1 and (a, k) = 1. The length n may be any multiple of e. The proof of this theorem also shows that if a cyclic (n,k) code over GF(q) is not a repetition of a shorter code and the average weight of its nonzero code words is integral, then its parity check polynomial is irreducible over GF(q) with exponent where a divides q − 1.