Skip to content

Manu577228/NumberTheory-Based-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 NumberTheory-Based-Algorithms

Welcome to Number Theory Based Algorithms — a comprehensive, hands-on collection of essential and advanced Number Theory algorithms implemented in both Java and Python.
This repository is designed for competitive programmers, math enthusiasts, and algorithmic learners who wish to deeply understand and efficiently implement number-theoretic techniques.

All algorithms here are explained in detail on my YouTube channel — where I teach every concept from scratch, with complete mathematical proofs, examples, and live coding.
🎥 Watch all tutorials here: Code with Bharadwaj


📘 Repository Overview

This repository contains efficient, well-structured implementations of core number theory algorithms. Each file is named in order, covering a wide range of concepts — from prime sieving to cryptographic number operations.

# Algorithm Name Java File Python File
88 Sieve of Eratosthenes 88.SieveOfEratosthenesAlgo.java 88.SieveOfEratosthenesAlgo.py
89 Segmented Sieve 89.SegmentedSieveAlgo.java 89.SegmentedSieveAlgo.py
90 Euclidean Algorithm (GCD) 90.EuclideanAlgo.java 90.EuclideanAlgo.py
91 Extended Euclidean Algorithm 91.ExtendedEuclideanAlgo.java 91.ExtendedEuclideanAlgo.py
92 Modular Exponentiation 92.ModularExponentiationAlgo.java 92.ModularExponentiationAlgo.py
93 Modular Inverse 93.ModularInverseAlgo.java 93.ModularInverseAlgo.py
94 Chinese Remainder Theorem 94.ChineseRemainderTheoremAlgo.java 94.ChineseRemainderTheoremAlgo.py
95 Euler’s Totient Function 95.Euler’sTotientFunctionAlgo.java 95.Euler’sTotientFunctionAlgo.py
96 Miller–Rabin Primality Test 96.Miller–RabinPrimalityTestAlgo.java 96.Miller–RabinPrimalityTestAlgo.py
97 Pollard’s Rho Factorization 97.Pollard’sRhoFactorizationAlgo.java 97.Pollard’sRhoFactorizationAlgo.py
98 Fast Fourier Transform (FFT) 98.FastFourierTransformAlgo.java 98.FastFourierTransformAlgo.py
99 Number Theoretic Transform (NTT) 99.NumberTheoreticTransformAlgo.java 99.NumberTheoreticTransformAlgo.py

🧠 What You’ll Learn

Each algorithm comes with:

  • ✅ Clean, optimized code for Java and Python
  • 🧩 Mathematical explanations behind the logic
  • ⚡ Time and space complexity analysis
  • 💡 Real-world and competitive programming applications

Topics covered include:

  • Prime number generation and testing
  • Modular arithmetic and exponentiation
  • GCD, LCM, and modular inverses
  • Chinese Remainder Theorem
  • Euler’s Totient and number-theoretic transforms
  • Cryptographic factorization and primality algorithms

🎓 Learn with My YouTube Tutorials

I’ve personally explained and demonstrated all these algorithms on my YouTube channel, with visuals, dry runs, and mathematical proofs for each one.
📺 Watch them here → Code with Bharadwaj

Perfect for mastering Number Theory in Competitive Programming and understanding the math behind algorithms like RSA, FFT, and modular systems.


🧰 Tech Stack

  • Languages: Java & Python
  • Java I/O: BufferedReader, PrintWriter for fast input/output
  • Design: Focused on clarity, modularity, and algorithmic performance
  • IDE: IntelliJ IDEA / VS Code

👨‍💻 Author

Manu Bharadwaj BN
🎥 YouTube: Code with Bharadwaj
💻 GitHub: Manu577228
🌐 Portfolio


🌟 Support & Contribute

If you find this repository useful:

  • ⭐ Star this repository
  • 🔔 Subscribe on YouTube
  • 🧠 Fork and contribute your implementations

“Mathematics is the language in which God has written the universe.” — Galileo Galilei


📄 License

Released under the MIT License — feel free to use, modify, and share with proper credit.

About

Number Theory based algorithms explained in detail using Python/Java.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •