#12116: perfect_power for integers
----------------------------------------------------------------+-----------
Reporter: roed |
Owner: AlexGhitza
Type: enhancement |
Status: needs_work
Priority: major |
Milestone: sage-5.8
Component: basic arithmetic |
Resolution:
Keywords: | Work
issues:
Report Upstream: Fixed upstream, but not in a stable release. |
Reviewers: David Loeffler, Aly Deines
Authors: David Roe | Merged
in:
Dependencies: #10596, #12363, #12638 |
Stopgaps:
----------------------------------------------------------------+-----------
Changes (by spice):
* status: positive_review => needs_work
Comment:
Everything checks out. Patch applies, tests pass. However:
{{{
def perfect_power(self):
r"""
Returns ``(a, b)``, where this integer is `b^a` and `a` is maximal.
...
}}}
So
{{{
sage: a = 11^14
sage: a.perfect_power()
(14, 11)
}}}
I know the code just wraps PARI which returns the integers in this order,
but this seems an unnatural way to order the returned pair.
I've uploaded a modified version of the patch so that we get
{{{
sage: a = 11^14
sage: a.perfect_power()
(11, 14)
}}}
which feels a lot more natural.
The new patch also fixes a possible formatting error in the documentation
of `self.is_perfect_power()`:
{{{
Returns ``True`` if self is a perfect power, ie if there exist integers
a and b, `b > 1` with `\texttt{self} = a^b`.
}}}
becomes
{{{
Returns ``True`` if ``self`` is a perfect power, ie if there exist
integers
`a` and `b`, `b > 1` with ``self`` `= a^b`.
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12116#comment:26>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.