#5250: [with patch, needs review] Bug in multiplicative_generator function for
Z/NZ
---------------------------+------------------------------------------------
 Reporter:  was            |       Owner:  davidloeffler
     Type:  defect         |      Status:  assigned     
 Priority:  major          |   Milestone:  sage-4.0     
Component:  number theory  |    Keywords:               
---------------------------+------------------------------------------------
Changes (by davidloeffler):

  * owner:  was => davidloeffler
  * status:  new => assigned


Comment:

 This comes up whenever n is twice a power of an odd prime. In these cases,
 {{{multiplicative_group_is_cyclic}}} would wrongly return False,
 {{{multiplicative_generator}}} would throw an error and {{{unit_gens}}}
 would return a list of length 2 one of whose elements is 1.

 The attached patch fixes this. It also streamlines the code a bit by using
 the is_prime_power function; this is more readable, and in theory should
 be quicker than factorisation. At the moment it is actually a tiny
 fraction slower, but this is a consequence of an awkward workaround for a
 Pari bug (see #4777) and it will presumably be fixed in the future.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5250#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to