{"id":22916378,"url":"https://github.com/ramsyana/zig-math-algorithms","last_synced_at":"2025-04-01T12:43:31.580Z","repository":{"id":267914418,"uuid":"902740352","full_name":"ramsyana/Zig-Math-Algorithms","owner":"ramsyana","description":"A collection of mathematical algorithms implemented in Zig, designed to address specific mathematical problems with simple command-line interfaces.","archived":false,"fork":false,"pushed_at":"2025-02-25T04:59:36.000Z","size":99,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T05:29:52.949Z","etag":null,"topics":["algorithms","math","zig","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramsyana.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-13T07:10:11.000Z","updated_at":"2025-02-25T05:00:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"3408bf52-5e8a-4656-8086-2a0edd0c2f7f","html_url":"https://github.com/ramsyana/Zig-Math-Algorithms","commit_stats":null,"previous_names":["ramsyana/zig-math-algorithms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsyana%2FZig-Math-Algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsyana%2FZig-Math-Algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsyana%2FZig-Math-Algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsyana%2FZig-Math-Algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramsyana","download_url":"https://codeload.github.com/ramsyana/Zig-Math-Algorithms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246642100,"owners_count":20810545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","math","zig","ziglang"],"created_at":"2024-12-14T06:12:36.091Z","updated_at":"2025-04-01T12:43:31.570Z","avatar_url":"https://github.com/ramsyana.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zig Math Algorithms\n\nA collection of mathematical algorithms implemented in Zig, designed for educational purposes and showcasing Zig's performance.\n\n## 🚀 Table of Contents\n\n- [Zig Math Algorithms](#zig-math-algorithms)\n  - [🚀 Table of Contents](#-table-of-contents)\n  - [🔢 Available Algorithms](#-available-algorithms)\n  - [🚀 Prerequisites](#-prerequisites)\n  - [🔧 Running the Algorithms](#-running-the-algorithms)\n  - [📚 Purpose](#-purpose)\n  - [📝 License](#-license)\n  - [🤝 Contributing](#-contributing)\n  - [📧 Contact](#-contact)\n\n## 🔢 Available Algorithms\n\n| Algorithm | Description | Command | Difficulty |\n|-----------|-------------|---------|------------|\n| **Basic Number Operations** |\n| Prime Number Checker | Checks if a number is prime | `zig run src/algorithm/math/prime_checker.zig` | Easy |\n| Armstrong Number Checker | Verifies Armstrong numbers | `zig run src/algorithm/math/is_armstrong.zig` | Easy |\n| Happy Number Checker | Checks if a number is happy | `zig run src/algorithm/math/happy_number.zig` | Easy |\n| Palindrome Number Checker | Checks if a number is a palindrome | `zig run src/algorithm/math/palindrome_number.zig` | Easy |\n| Sum of Digits | Calculates digit sum | `zig run src/algorithm/math/sum_of_digits.zig` | Easy |\n| Digital Root | Recursive digit sum calculation | `zig run src/algorithm/math/digital_root.zig` | Easy |\n| Reverse Number | Reverses digits of a number | `zig run src/algorithm/math/reverse_number.zig` | Easy |\n| Power of Two Checker | Checks if number is 2ⁿ | `zig run src/algorithm/math/power_of_two.zig` | Easy |\n| Integer Square Root | Finds floor(√n) | `zig run src/algorithm/math/integer_sqrt.zig` | Easy |\n| Leap Year Checker | Determines if year is leap | `zig run src/algorithm/math/leap_year_checker.zig` | Easy |\n| **Number Theory** |\n| Sieve of Eratosthenes | Generates prime numbers efficiently | `zig run src/algorithm/math/sieve_of_eratosthenes.zig` | Medium |\n| Perfect Number Checker | Checks if a number is perfect | `zig run src/algorithm/math/perfect_number_checker.zig` | Easy |\n| Abundant/Deficient Checker | Checks if number is abundant/deficient | `zig run src/algorithm/math/abundant_deficient_checker.zig` | Easy |\n| Strong Number Checker | Sum of digit factorials check | `zig run src/algorithm/math/strong_number_checker.zig` | Easy |\n| GCD and LCM Calculator | Finds GCD and LCM | `zig run src/algorithm/math/gcd_lcm_calculator.zig` | Medium |\n| Prime Factorization | Computes prime factors | `zig run src/algorithm/math/prime_factorization.zig` | Medium |\n| Prime Counter | Counts primes up to n | `zig run src/algorithm/math/prime_counter.zig` | Medium |\n| Euler's Totient Function | Counts coprime numbers | `zig run src/algorithm/math/euler_totient.zig` | Hard |\n| Fermat's Factorization 🆕 | Factors integers using difference of squares | `zig run src/algorithm/math/fermats_factorization.zig` | Medium |\n| Modular Exponentiation 🆕 | Efficiently computes (base^exp) % mod | `zig run src/algorithm/math/modular_exponentiation.zig` | Medium |\n| **Sequences and Series** |\n| Fibonacci Calculator | Calculates nth Fibonacci | `zig run src/algorithm/math/fibonacci.zig` | Easy |\n| Lucas Numbers | Generates Lucas numbers | `zig run src/algorithm/math/lucas_numbers.zig` | Easy |\n| Factorial Calculator | Calculates n! | `zig run src/algorithm/math/factorial.zig` | Easy |\n| Sequence Generator | Arithmetic/Geometric sequences | `zig run src/algorithm/math/sequence_generator.zig` | Easy |\n| Trailing Zeros in Factorial | Counts trailing zeros in n! | `zig run src/algorithm/math/factorial_trailing_zeroes.zig` | Medium |\n| Collatz Conjecture | Steps to reach 1 | `zig run src/algorithm/math/collatz_conjecture.zig` | Medium |\n| Catalan Calculator | Calculates nth Catalan | `zig run src/algorithm/math/catalan.zig` | Hard |\n| Pascal's Triangle 🆕 | Generates Pascal's triangle up to n rows | `zig run src/algorithm/math/pascals_triangle.zig` | Easy |\n| **Advanced Mathematics** |\n| Binomial Coefficient | Pascal's triangle coefficients | `zig run src/algorithm/math/binomial_coefficient.zig` | Medium |\n| Cantor Set Generator | Generates Cantor set | `zig run src/algorithm/math/cantor_set.zig -- 0 1 3` | Hard |\n| Extended Euclidean | GCD and Bézout coefficients | `zig run src/algorithm/math/euclidean_algorithm_extended.zig` | Hard |\n| Linear Interpolation | Linear interpolation | `zig run src/algorithm/math/linear_interpolation.zig` | Hard |\n| Chinese Remainder | Solves linear congruences | `zig run src/algorithm/math/chinese_remainder.zig` | Hard |\n| Karatsuba Multiplication 🆕 | Efficient multiplication algorithm | `zig run src/algorithm/math/karatsuba.zig` | Hard |\n| Fast Fourier Transform 🆕 | Computes the FFT of a sequence | `zig run src/algorithm/math/fft.zig` | Hard |\n## 🚀 Prerequisites\n\n- **Zig Compiler**: \n  - Latest version recommended. Install via:\n\n    ```shell\n    sh -c \"$(curl -fsSL https://ziglang.org/download/index.json | jq -r '.master.url')\"\n    ```\n\n## 🔧 Running the Algorithms\n\nTo run any algorithm, use the Zig run command followed by the specific algorithm file path and any required arguments. For example:\n\n```shell\nzig run src/algorithm/math/prime_checker.zig\n# or\nzig test src/algorithm/math/prime_checker.zig\n```\n\nMore information is available in the respective file comment header.\n\n## 📚 Purpose\n\nThis repository provides a collection of mathematical algorithms implemented in Zig, showcasing the language's capabilities and performance. Each module is designed to be easily run and tested, making it a useful resource for learning and experimentation.\n\n## 📝 License\n\nMIT License\n\nCopyright (c) 2025 Ramsyana\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## 🤝 Contributing\nContributions are welcome! Here's how to contribute:\n- Fork the repository\n- Create your feature branch (git checkout -b feature/AmazingFeature)\n- Commit your changes (git commit -m 'Add some AmazingFeature')\n- Push to the branch (git push origin feature/AmazingFeature)\n- Open a pull request\n\n## 📧 Contact\n\nRamsyana - ramsyana[at]mac[dot]com\n\nI'm a system engineering enthusiast. Feel free to fork, clone, open issues, or contribute to this project. Don’t hesitate to reach out with any questions, suggestions, or collaboration ideas!\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framsyana%2Fzig-math-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framsyana%2Fzig-math-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framsyana%2Fzig-math-algorithms/lists"}