You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 282157a
Browse filesBrowse the repository at this point in the historyBrowse files
harmonicnumber(n) and harmonicnumber(n, m) were reserved by name in #2184 and are now
Entity.HarmonicNumberf, built by MathS.HarmonicNumber.
For a whole n >= 0 they are 1 + 1/2^m + ... + 1/n^m, summed exactly for a rational order:
harmonicnumber(4) is 25/12 and harmonicnumber(4, 2) is 205/144. Elsewhere they are
zeta(m) - zeta(m, n + 1), as Mathematica's HarmonicNumber is, which is evaluated numerically for a
whole m >= 1 through the polygamma function: psi(n + 1) - psi(1) at m = 1, and
(-1)^m / (m - 1)! (psi^(m - 1)(1) - psi^(m - 1)(n + 1)) above it. harmonicnumber(1/2) is 2 - 2 ln 2
and agrees with mpmath to 1e-25, as do H(5/2), H(-1/2) and H(1/2, 2). A negative integer n is a pole
of the Hurwitz zeta function, and has no value but for a whole order m <= 0, where the harmonic
number is a polynomial in n. What is not computed is left as the node.
They print as harmonicnumber(n) and harmonicnumber(n, m), draw as \operatorname{H}_{n} and
\operatorname{H}_{n}^{(m)}, and export to SymPy's harmonic.
Part of #2182.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
### The Möbius, divisor and prime-counting functions
502
502
@@ -532,6 +532,19 @@ is ([#2182](https://github.com/asc-community/AngouriMath/issues/2182)).
532
532
| `"hessian(x^3 y^2, [x, y])".ToEntity().Simplify()` | throws `UnhandledParseException` | `[[6 * x * y ^ 2, 6 * x ^ 2 * y], [6 * x ^ 2 * y, 2 * x ^ 3]]` |
533
533
| `"jacobian(x y, {x, y})".ToEntity()` | throws `UnhandledParseException` | throws `InvalidArgumentParseException`: a set has no order for the columns |
534
534
535
+
### The harmonic numbers
536
+
537
+
**Not silent: `harmonicnumber(n)` and `harmonicnumber(n, m)` are the harmonic numbers, where the one was a product and the
538
+
other a parse error.** They are `1 + 1/2^m + ... + 1/n^m` for a whole `n >= 0`, exact for a rational `m`, and
539
+
`ζ(m) - ζ(m, n + 1)` elsewhere, as Mathematica's `HarmonicNumber` is: `ψ(n + 1) - ψ(1)` for `m = 1`, evaluated numerically
540
+
through `digamma` and `polygamma` for a whole `m >= 1`. A negative integer `n` has no value but for a whole `m <= 0`
0 commit comments