Skip to content

Refactor Lucas sequence code #15625

@jpflori

Description

@jpflori

As pointed by Paul Zimmerman in #11802 comment:16, the Lucas sequence which has been finally sped up and generalized in #11802, needs serious refactoring:

  1. it makes no sense to have a slow_lucas and a fast_lucas function. The philosophy in Sage is to use algorithm='recurrence' or algorithm='matrix_exponentiation' instead (for example).

  2. I don't see why the case Q<>1 could not be implemented either by the recurrence or the matrix
    exponentiation.

  3. instead of separate functions for ZZ and IntegerModRing(n), it would be nicer to have a single function with an option ring=ZZ (default) and ring=IntegerModRing(15).

CC: @tscrim @zimmermann6 @rwst

Component: basic arithmetic

Keywords: lucas sequence

Issue created by migration from https://trac.sagemath.org/ticket/15625

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions