#16671: implement harmonic number function H(n,m)
-------------------------+-------------------------------------------------
Reporter: rws | Owner:
Type: | Status: needs_work
defect | Milestone: sage-6.4
Priority: major | Resolution:
Component: | Merged in:
symbolics | Reviewers:
Keywords: | Work issues:
special, log | Commit:
Authors: Ralf | fabf86397adf8c07ce9b63b64c64e5f724702d21
Stephan | Stopgaps:
Report Upstream: N/A |
Branch: |
u/rws/16671 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by jdemeyer):
I don't agree with `sum(QQ(1)/(k**m) for k in range(1,z+1))` since the
result is always in `QQ`. I would use `srange` to respect the input type
(`foo in ZZ` does not imply that the type of `foo` is `ZZ`):
{{{
sum(1/(k**m) for k in srange(1,z+1))
}}}
Artificial example (this could be a doctest):
{{{
sage: harmonic_number._eval_(10, Qp(5)(1))
7381/2520
}}}
but the answer should be
{{{
sage: Qp(5)(harmonic_number(10))
4*5^-1 + 2 + 2*5 + 4*5^2 + 3*5^3 + 5^4 + 4*5^5 + 4*5^6 + 5^7 + 4*5^8 +
3*5^9 + 5^10 + 4*5^11 + 4*5^12 + 5^13 + 4*5^14 + 3*5^15 + 5^16 + 4*5^17 +
4*5^18 + O(5^19)
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/16671#comment:47>
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.
For more options, visit https://groups.google.com/d/optout.