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 0348dfc
Browse filesBrowse the repository at this point in the historyBrowse files
mobius(n), divisorsigma(k, n), primenu(n), primeomega(n) and primepi(x) were reserved by name in
built by MathS.NumberTheory.Mobius, DivisorSigma, PrimeNu, PrimeOmega and PrimePi.
mobius is the Möbius function: 0 where the square of a prime divides n, (-1)^k for a product of k
distinct primes, and 1 at 1. moebiusmu, Mathematica's name for it, reads as the same function.
divisorsigma(k, n) is sigma_k(n), the order first as the notation and Mathematica's
DivisorSigma[k, n] write it. It is the product over the prime powers p^a in n of
1 + p^k + ... + p^(ak), exact for a rational order and an expression for any other number:
divisorsigma(1/2, 4) is 3 + sqrt(2). primenu and primeomega are omega and Omega, the number of
prime factors without and with multiplicity. The four are defined on the positive integers, NaN at
any other number, and left as written for an expression.
The factorisation is trial division up to a million. That settles every number up to 10^12, and a
larger one whose part left after the small primes is below 10^12; anything else is left as written,
and 2^100 is factorised at once. primepi(x) counts the primes up to floor(x) by a sieve over the odd
numbers, for a real x up to ten million (94 ms there), and is NaN off the real line.
They print by name, draw as \operatorname{\mu}(n), \operatorname{\sigma}_k(n),
\operatorname{\omega}(n), \operatorname{\Omega}(n) and \operatorname{\pi}(x), so that a Greek
letter is not read back as a variable times a bracket, and export to SymPy's mobius,
divisor_sigma(n, k), primenu, primeomega and primepi. Their codomains are the integers, and the
non-negative integers for the three counts. The MCP server's syntax document and the syntax page
name them, and the native smoke test evaluates them.
Part of #2182.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
| 'union(' args = function_arguments ')' { Assert("union", 2, $args.list.Count); $value = $args.list[1] is Entity.Set.Inf { Element: Variable } unionRange ? MathS.Sets.IndexedUnion($args.list[0], unionRange.Element, unionRange.SupSet) : throw new InvalidArgumentParseException("union expects its second argument to say which name ranges over which set, as in union(A_i, i in I)"); }
0 commit comments