grscheller.boring-math


Namegrscheller.boring-math JSON
Version 0.3.1 PyPI version JSON
download
home_pageNone
SummaryLibraries of a mathematical nature with example executables.
upload_time2024-03-09 17:55:53
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords math mathematics lcm gcd primes comb combinations pythagorean triples ackermann fibonacci
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyPI grscheller.boring-math Project

Daddy's boring math library.

* Python package of modules of a mathematical nature
* Project name suggested by my then 13 year old daughter Mary
* See [grscheller.boring-math][1] project on PyPI
* See [Detailed API documentation][2] on GH-Pages
* See [Source code][3] on GitHub

Here are the [modules](#library-modules) and
[executables](#cli-applications) which make up the PyPI
grscheller.boring_math package.

## Library Modules

* Integer Math Module
  * Number Theory
    * Function **gcd**(int, int) -> int
      * greatest common divisor of two integers
      * always returns a non-negative number greater than 0
    * Function **lcm**(int, int) -> int
      * least common multiple of two integers
      * always returns a non-negative number greater than 0
    * Function **coprime**(int, int) -> Tuple(int, int)
      * make 2 integers coprime by dividing out gcd
      * preserves signs of original numbers
    * Function **iSqrt**(int) -> int
      * integer square root
      * same as math.isqrt
    * Function **isSqr**(int) -> bool
      * returns true if integer argument is a perfect square
    * Function **primes**(start: int, end_before: int) -> Iterator
      * uses *Sieve of Eratosthenes* algorithm
  * Combinatorics
    * Function **comb**(n: int, m: int) -> int
      * returns number of combinations of n items taken m at a time
      * pure integer implementation of math.comb
  * Fibonacci Sequences
    * Function **fibonacci**(f0: int=0, f1: int=1) -> Iterator
      * returns a *Fibonacci* sequence iterator
      * `f(n) = f(n-1) + f(n-2)`
      * `f(0) = f0` and `f(1) = f1`
      * defaults to `0, 1, 1, 2, 3, 5, 8, 13, ...`

---

* Pythagorean Triple Module
  * Pythagorean Triple Class
    * Method **Pythag3.triples**(a_start: int, a_max: int, max: int) -> Iterator
      * Returns an interator of tuples of primative *Pythagorean* triples
    * A *Pythagorean* triple is a tuple in positive integers (a, b, c)
      * such that `a**2 + b**2 = c**2` 
      * `a, b, c` represent integer sides of a right triangle
      * a *Pythagorean* triple is primative if gcd of `a, b, c` is `1`
    * Iterator finds all primative pythagorean such that
      * `0 < a_start <= a < b < c <= max` where `a <= a_max`
      * if `max = 0` find all theoretically possible triples with `a <= a_max`

---

* Recursive Function Module
  * Ackermann's Function
    * Function **ackermann**(m: int, n: int) -> int
      * an example of a total computable function that is not primitive recursive
      * becomes numerically intractable after m=4
      * see CLI section below for mathematical definition

---

## CLI Applications

Implemented in an OS and package build tool independent way via the
project.scripts section of pyproject.toml.

#### Ackermann's function CLI scripts

Ackermann, a student of Hilbert, discovered early examples of totally
computable functions that are not primitively recursive.

A [fairly standard][4] definition of the Ackermann function is
recursively defined for `m,n >= 0` by

```
   ackermann(0,n) = n+1
   ackermann(m,0) = ackermann(m-1,1)
   ackermann(m,n) = ackermann(m-1, ackermann(m, n-1))
```

* CLI script **ackerman_list**
  * Given two non-negative integers, evaluates Ackermann's function
  * Implements the recursion via a Python array
  * Usage: `ackerman_list m n`

---

#### Pythagorean triple CLI script

Geometrically, a *Pythagorean* triangle is a right triangle with
with positive integer sides.

* CLI script **pythag3**
  * A Pythagorean triple is a 3-tuple of integers `(a, b, c)` such that
    * `a**2 + b**2 = c**2` where `a,b,c > 0` and `gcd(a,b,c) = 1`
  * The integers `a, b, c` represent the sides of a right triangle
  * Usage: `pythag3 [m [n [max]]`
    * 3 arguments print all triples with m <= a <= n and a < b < c <= max
    * 2 arguments print all triples with m <= a <= n
    * 1 argument prints all triples with a <= m
    * 0 arguments print all triples with 3 <= a <= 100

---

[1]: https://pypi.org/project/grscheller.boring-math/
[2]: https://grscheller.github.io/boring-math/API/development/html/grscheller/boring_math/index.html
[3]: https://github.com/grscheller/boring-math
[4]: https://mathworld.wolfram.com/AckermannFunction.html

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "grscheller.boring-math",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "math,mathematics,lcm,gcd,primes,comb,combinations,pythagorean triples,ackermann,fibonacci",
    "author": null,
    "author_email": "\"Geoffrey R. Scheller\" <geoffrey@scheller.com>",
    "download_url": "https://files.pythonhosted.org/packages/6c/38/0ae713f8178fb432f76835aca4f65ef9d6f9b8f21ef0ac41b8d94b4ef94b/grscheller_boring_math-0.3.1.tar.gz",
    "platform": null,
    "description": "# PyPI grscheller.boring-math Project\n\nDaddy's boring math library.\n\n* Python package of modules of a mathematical nature\n* Project name suggested by my then 13 year old daughter Mary\n* See [grscheller.boring-math][1] project on PyPI\n* See [Detailed API documentation][2] on GH-Pages\n* See [Source code][3] on GitHub\n\nHere are the [modules](#library-modules) and\n[executables](#cli-applications) which make up the PyPI\ngrscheller.boring_math package.\n\n## Library Modules\n\n* Integer Math Module\n  * Number Theory\n    * Function **gcd**(int, int) -> int\n      * greatest common divisor of two integers\n      * always returns a non-negative number greater than 0\n    * Function **lcm**(int, int) -> int\n      * least common multiple of two integers\n      * always returns a non-negative number greater than 0\n    * Function **coprime**(int, int) -> Tuple(int, int)\n      * make 2 integers coprime by dividing out gcd\n      * preserves signs of original numbers\n    * Function **iSqrt**(int) -> int\n      * integer square root\n      * same as math.isqrt\n    * Function **isSqr**(int) -> bool\n      * returns true if integer argument is a perfect square\n    * Function **primes**(start: int, end_before: int) -> Iterator\n      * uses *Sieve of Eratosthenes* algorithm\n  * Combinatorics\n    * Function **comb**(n: int, m: int) -> int\n      * returns number of combinations of n items taken m at a time\n      * pure integer implementation of math.comb\n  * Fibonacci Sequences\n    * Function **fibonacci**(f0: int=0, f1: int=1) -> Iterator\n      * returns a *Fibonacci* sequence iterator\n      * `f(n) = f(n-1) + f(n-2)`\n      * `f(0) = f0` and `f(1) = f1`\n      * defaults to `0, 1, 1, 2, 3, 5, 8, 13, ...`\n\n---\n\n* Pythagorean Triple Module\n  * Pythagorean Triple Class\n    * Method **Pythag3.triples**(a_start: int, a_max: int, max: int) -> Iterator\n      * Returns an interator of tuples of primative *Pythagorean* triples\n    * A *Pythagorean* triple is a tuple in positive integers (a, b, c)\n      * such that `a**2 + b**2 = c**2` \n      * `a, b, c` represent integer sides of a right triangle\n      * a *Pythagorean* triple is primative if gcd of `a, b, c` is `1`\n    * Iterator finds all primative pythagorean such that\n      * `0 < a_start <= a < b < c <= max` where `a <= a_max`\n      * if `max = 0` find all theoretically possible triples with `a <= a_max`\n\n---\n\n* Recursive Function Module\n  * Ackermann's Function\n    * Function **ackermann**(m: int, n: int) -> int\n      * an example of a total computable function that is not primitive recursive\n      * becomes numerically intractable after m=4\n      * see CLI section below for mathematical definition\n\n---\n\n## CLI Applications\n\nImplemented in an OS and package build tool independent way via the\nproject.scripts section of pyproject.toml.\n\n#### Ackermann's function CLI scripts\n\nAckermann, a student of Hilbert, discovered early examples of totally\ncomputable functions that are not primitively recursive.\n\nA [fairly standard][4] definition of the Ackermann function is\nrecursively defined for `m,n >= 0` by\n\n```\n   ackermann(0,n) = n+1\n   ackermann(m,0) = ackermann(m-1,1)\n   ackermann(m,n) = ackermann(m-1, ackermann(m, n-1))\n```\n\n* CLI script **ackerman_list**\n  * Given two non-negative integers, evaluates Ackermann's function\n  * Implements the recursion via a Python array\n  * Usage: `ackerman_list m n`\n\n---\n\n#### Pythagorean triple CLI script\n\nGeometrically, a *Pythagorean* triangle is a right triangle with\nwith positive integer sides.\n\n* CLI script **pythag3**\n  * A Pythagorean triple is a 3-tuple of integers `(a, b, c)` such that\n    * `a**2 + b**2 = c**2` where `a,b,c > 0` and `gcd(a,b,c) = 1`\n  * The integers `a, b, c` represent the sides of a right triangle\n  * Usage: `pythag3 [m [n [max]]`\n    * 3 arguments print all triples with m <= a <= n and a < b < c <= max\n    * 2 arguments print all triples with m <= a <= n\n    * 1 argument prints all triples with a <= m\n    * 0 arguments print all triples with 3 <= a <= 100\n\n---\n\n[1]: https://pypi.org/project/grscheller.boring-math/\n[2]: https://grscheller.github.io/boring-math/API/development/html/grscheller/boring_math/index.html\n[3]: https://github.com/grscheller/boring-math\n[4]: https://mathworld.wolfram.com/AckermannFunction.html\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Libraries of a mathematical nature with example executables.",
    "version": "0.3.1",
    "project_urls": {
        "Changelog": "https://github.com/grscheller/boring-math/blob/main/CHANGELOG.md",
        "Documentation": "https://grscheller.github.io/boring-math/",
        "Source": "https://github.com/grscheller/boring-math"
    },
    "split_keywords": [
        "math",
        "mathematics",
        "lcm",
        "gcd",
        "primes",
        "comb",
        "combinations",
        "pythagorean triples",
        "ackermann",
        "fibonacci"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a48cb54be05219d77ad01a99666e0db5c611cf1a51e13687b720df0573051f0a",
                "md5": "f1e327d036574a66ddc14052c2700f51",
                "sha256": "d3f2a5eb7c8a6a0649aa8cc149f19b2f21be5bba7afbe8be8e3c0cb9639aa91b"
            },
            "downloads": -1,
            "filename": "grscheller_boring_math-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f1e327d036574a66ddc14052c2700f51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 15971,
            "upload_time": "2024-03-09T17:55:51",
            "upload_time_iso_8601": "2024-03-09T17:55:51.110611Z",
            "url": "https://files.pythonhosted.org/packages/a4/8c/b54be05219d77ad01a99666e0db5c611cf1a51e13687b720df0573051f0a/grscheller_boring_math-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6c380ae713f8178fb432f76835aca4f65ef9d6f9b8f21ef0ac41b8d94b4ef94b",
                "md5": "3c4b7e6086d369f71e5072b4d719aa67",
                "sha256": "bec59f9199e8cafc23199ac8c61a7accdfd2152d145ae0773aaa914f0d7e3a8b"
            },
            "downloads": -1,
            "filename": "grscheller_boring_math-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3c4b7e6086d369f71e5072b4d719aa67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 15912,
            "upload_time": "2024-03-09T17:55:53",
            "upload_time_iso_8601": "2024-03-09T17:55:53.049787Z",
            "url": "https://files.pythonhosted.org/packages/6c/38/0ae713f8178fb432f76835aca4f65ef9d6f9b8f21ef0ac41b8d94b4ef94b/grscheller_boring_math-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-09 17:55:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "grscheller",
    "github_project": "boring-math",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "grscheller.boring-math"
}
        
Elapsed time: 0.20247s