code: function algebraCyclic (elements) {
    if (!isPrime(elements.length)) {
      throw new TypeError(error.groupCardinalityIsNotPrime)
    }
  
    if (!unique(elements)) {
      throw new TypeError(error.elementsAreNotUnique)
    }
  
    var zero = elements[0]
    var one = elements[1]
  
    function numOf (element) {
      return elements.indexOf(element)
    }
  
    function addition (element1, element2) {
      var n = numOf(element1) + numOf(element2)
  
      n = n % elements.length
  
      return elements[n]
    }
  
    function contains (element) {
      return elements.indexOf(element) > -1
    }
  
    function multiplication (element1, element2) {
      var n = numOf(element1) * numOf(element2)
  
      n = n % elements.length
  
      return elements[n]
    }
  
    function inversion (element) {
      for (var i = 0; i < elements.length; i++) {
        if (elements[1] === multiplication(element, elements[i])) {
          return elements[i]
        }
      }
    }
  
    function negation (element) {
      var n = numOf(element)
  
      if (n === 0) return element
  
      n = elements.length - n
  
      return elements[n]
    }
  
    function equality (element1, element2) {
      return element1 === element2
    }
  
    return algebraRing([zero, one], {
      equality: equality,
      contains: contains,
      addition: addition,
      negation: negation,
      multiplication: multiplication,
      inversion: inversion
    })
  }
docs: Construct a space isomorphic to Zp: the cyclic group of order p, where p is prime.
  
  @param {Array|String} elements
  
  @returns {Object} cyclic ring