Пример #1
0
 def unit_group_exponent(self):
     """
     EXAMPLES::
     
         sage: R = IntegerModRing(17)
         sage: R.unit_group_exponent()
         16
         sage: R = IntegerModRing(18)
         sage: R.unit_group_exponent()
         6
     """
     if self.__unit_group_exponent != None:
         return self.__unit_group_exponent
     a = []
     for p, r in self.factored_order():
         if p != 2:
             a.append((p - 1) * (p**(r - 1)))  # phi(p**r)
         else:  # p=2
             if r == 2:
                 a.append(2)
             elif r > 2:
                 a.append(2**(r - 2))
         #endif
     #endfor
     self.__unit_group_exponent = int(LCM(a))
     return self.__unit_group_exponent
Пример #2
0
    def unit_group_exponent(self):
        """
        EXAMPLES::

            sage: R = IntegerModRing(17)
            sage: R.unit_group_exponent()
            16
            sage: R = IntegerModRing(18)
            sage: R.unit_group_exponent()
            6
        """
        if self.__unit_group_exponent != None:
            return self.__unit_group_exponent
        a = []
        for p, r in self.factored_order():
            if p != 2:
                a.append((p-1)*(p**(r-1)))   # phi(p**r)
            else:  # p=2
                if r==2:
                    a.append(2)
                elif r>2:
                    a.append(2**(r-2))
            #endif
        #endfor
        self.__unit_group_exponent = int(LCM(a))
        return self.__unit_group_exponent
Пример #3
0
    def unit_group_exponent(self):
        """
        EXAMPLES::

            sage: R = IntegerModRing(17)
            sage: R.unit_group_exponent()
            16
            sage: R = IntegerModRing(18)
            sage: R.unit_group_exponent()
            6
        """
        a = []
        for p, r in self.factored_order():
            if p != 2:
                a.append((p-1)*(p**(r-1)))   # phi(p**r)
            elif r==2: # p=2 from this point on
                a.append(2)
            elif r>2:
                a.append(2**(r-2))
        return int(LCM(a))
    def unit_group_exponent(self):
        """
        EXAMPLES::

            sage: R = IntegerModRing(17)
            sage: R.unit_group_exponent()
            16
            sage: R = IntegerModRing(18)
            sage: R.unit_group_exponent()
            6
        """
        a = []
        for p, r in self.factored_order():
            if p != 2:
                a.append((p - 1) * (p**(r - 1)))  # phi(p**r)
            elif r == 2:  # p=2 from this point on
                a.append(2)
            elif r > 2:
                a.append(2**(r - 2))
        return int(LCM(a))