#10836: primitive root is broken
--------------------------------------------------+-------------------------
   Reporter:  kcrisman                            |       Owner:  was           
                                
       Type:  defect                              |      Status:  
positive_review                               
   Priority:  critical                            |   Milestone:  sage-4.7      
                                
  Component:  number theory                       |    Keywords:                
                                
     Author:  Karl-Dieter Crisman, William Stein  |    Upstream:  Reported 
upstream. Developers deny it's a bug.
   Reviewer:  William Stein, Karl-Dieter Crisman  |      Merged:                
                                
Work_issues:                                      |  
--------------------------------------------------+-------------------------
Changes (by kcrisman):

  * status:  needs_review => positive_review


Old description:

> Pari has a major bug in its primitive root:
> {{{
> sage: primitive_root(15)
> 2
> sage: mod(2,15).multiplicative_order()
> 4
> sage: euler_phi(15)
> 8
> sage: [mod(2,15)^i for i in [1..8]]
> [2, 4, 8, 1, 2, 4, 8, 1]
> sage: b = pari(15)
> sage: b.znprimroot()
> Mod(2, 15)
> }}}
> Note that this DOES work correctly with whatever Pari is in Sage 4.4.4.
> {{{
> ---------------------------------------------------------------------
> | Sage Version 4.4.4, Release Date: 2010-06-23                       |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> Loading Sage library. Current Mercurial branch is: hackbranch
> sage: primitive_root(15)
> <snip>
> ArithmeticError: There is no primitive root modulo n
> }}}

New description:

 Pari has a major bug in its primitive root:
 {{{
 sage: primitive_root(15)
 2
 sage: mod(2,15).multiplicative_order()
 4
 sage: euler_phi(15)
 8
 sage: [mod(2,15)^i for i in [1..8]]
 [2, 4, 8, 1, 2, 4, 8, 1]
 sage: b = pari(15)
 sage: b.znprimroot()
 Mod(2, 15)
 }}}
 Note that this DOES work correctly with whatever Pari is in Sage 4.4.4.
 {{{
 ---------------------------------------------------------------------
 | Sage Version 4.4.4, Release Date: 2010-06-23                       |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 Loading Sage library. Current Mercurial branch is: hackbranch
 sage: primitive_root(15)
 <snip>
 ArithmeticError: There is no primitive root modulo n
 }}}

 ----
 Apply only [attachment:trac_10836.2.patch].

--

Comment:

 Had to fix one tiny thing for the note to look right.  Positive review.

 Apply only [attachment:trac_10836.2.patch].

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10836#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
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