Skip to content

Commit

Permalink
Clean up math equations
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Jul 24, 2022
1 parent 373a246 commit 23337ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions galois/_modular.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def carmichael_lambda(n: int) -> int:
Returns
-------
:
The smallest positive integer :math:`m` such that :math:`a^m \equiv 1 (\textrm{mod}\ n)` for
The smallest positive integer :math:`m` such that :math:`a^m \equiv 1\ (\textrm{mod}\ n)` for
every :math:`a` in :math:`[1, n)` that is coprime to :math:`n`.
See Also
Expand All @@ -183,14 +183,16 @@ def carmichael_lambda(n: int) -> int:
Examples
--------
The Carmichael lambda function and Euler totient function are often equal. However, there are notable exceptions.
The Carmichael :math:`\lambda(n)` function and Euler :math:`\phi(n)` function are often equal. However, there are
notable exceptions.
.. ipython:: python
[galois.euler_phi(n) for n in range(1, 20)]
[galois.carmichael_lambda(n) for n in range(1, 20)]
For prime :math:`n`, :math:`\phi(n) = \lambda(n) = n - 1`. And for most composite :math:`n`, :math:`\phi(n) = \lambda(n) < n - 1`.
For prime :math:`n`, :math:`\phi(n) = \lambda(n) = n - 1`. And for most composite :math:`n`,
:math:`\phi(n) = \lambda(n) < n - 1`.
.. ipython:: python
Expand Down
4 changes: 2 additions & 2 deletions galois/_prime.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def primes(n: int) -> List[int]:
@set_module("galois")
def kth_prime(k: int) -> int:
r"""
Returns the :math:`k`-th prime.
Returns the :math:`k`-th prime, where :math:`k = \{1,2,3,4,\dots\}` for primes :math:`p = \{2,3,5,7,\dots\}`.
:group: primes-generation
Parameters
----------
k
The prime index (1-indexed), where :math:`k = \{1,2,3,4,\dots\}` for primes :math:`p = \{2,3,5,7,\dots\}`.
The prime index (1-indexed).
Returns
-------
Expand Down

0 comments on commit 23337ad

Please sign in to comment.