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

  * status:  positive_review => needs_work
  * author:  Karl-Dieter Crisman, William Stein => Karl-Dieter Crisman,
             William Stein, Jeroen Demeyer


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
> }}}
>
> ----
> Apply only [attachment:trac_10836.2.patch].

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 [attachment:trac_10836.2.patch] and
 [attachment:10836_additional.patch].

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10836#comment:19>
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