Determination of the cyclicity of polytypes