Determine whether the following polynomials are generatorpolynomials of cyclic codes of given lengths:
(1) g(x) = 1 + x + x2 + x3 + x4for a binary cyclic code of length 7;
(2) g(x) = 2 + 2×2 + x3 for a ternary cycliccode of length 8.