#11802: Generation of Lucas sequences modulo an integer
--------------------------------+-------------------------------------------
   Reporter:  somindu           |          Owner:  AlexGhitza    
       Type:  enhancement       |         Status:  new           
   Priority:  minor             |      Milestone:  sage-4.7.2    
  Component:  basic arithmetic  |       Keywords:  Lucas sequence
Work_issues:                    |       Upstream:  N/A           
   Reviewer:                    |         Author:                
     Merged:                    |   Dependencies:                
--------------------------------+-------------------------------------------
 The Lucas sequence modulo an integer n is given by {{{V_k = PV_{k-1} - Q
 V_{k-2} mod n}}} with {{{V_0 = 2 and V_1 = P}}}. This is not implemented
 in Sage. There are algorithms {{{fast_lucas}}} and {{{slow_lucas}}} that
 compute this sequence only for the special case {{{Q=1}}}.
 {{{
 sage: from sage.rings.finite_rings.integer_mod import fast_lucas
 sage: [fast_lucas(i, Mod(8,11)) for i in range(15)]
 [2, 8, 7, 4, 3, 9, 3, 4, 7, 8, 2, 8, 7, 4, 3]
 }}}
 {{{
 sage: from sage.rings.finite_rings.integer_mod import slow_lucas
 sage: [slow_lucas(i, Mod(8,11)) for i in range(15)]
 [2, 8, 7, 4, 3, 9, 3, 4, 7, 8, 2, 8, 7, 4, 3]
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11802>
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