Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Greedy
2k+ articles
Dynamic Programming
1.5k+ articles
number-digits
600+ articles
number-theory
410+ articles
large-numbers
90+ articles
Modular Arithmetic
190+ posts
Popular Articles
Recent Articles
Modular Arithmetic
Last Updated: 25 February 2025
Modular arithmetic is a system of arithmetic for numbers where numbers "wrap around" after reaching a certain value, called the modulus. It
...read more
Modular Arithmetic
Engineering Mathematics
Mathematics
Modulo 10^9+7 (1000000007)
Last Updated: 28 November 2022
In most programming competitions, we are required to answer the result in 10^9+7 modulo. The reason behind this is, if problem constraints a
...read more
Mathematical
Competitive Programming
Modular Arithmetic
number-theory
DSA
Sum of all Subarrays
Last Updated: 26 November 2024
Given an integer array arr[], find the sum of all sub-arrays of the given array.Examples:Input: arr[] = [1, 2, 3]Output: 20Explanation: {1}
...read more
Arrays
Mathematical
Modular Arithmetic
subarray
subarray-sum
DSA
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Greedy
2k+ articles
Dynamic Programming
1.5k+ articles
number-digits
600+ articles
number-theory
410+ articles
large-numbers
90+ articles
Cyclic Redundancy Check and Modulo-2 Division
Last Updated: 27 April 2025
Cyclic Redundancy Check or CRC is a method of detecting accidental changes/errors in the communication channel. CRC uses Generator Polynomi
...read more
Bit Magic
Modular Arithmetic
DSA
Matrix Exponentiation
Last Updated: 08 April 2025
Matrix Exponentiation is a technique used to calculate a matrix raised to a power efficiently, that is in logN time. It is mostly used for s
...read more
Algorithms
Dynamic Programming
Mathematical
Matrix
Competitive Programming
Fibonacci
series
Modular Arithmetic
matrix-exponentiation
DSA
Modular Division
Last Updated: 20 January 2025
Modular division is the process of dividing one number by another in modular arithmetic. In modular arithmetic, division is defined differen
...read more
Mathematical
Modular Arithmetic
DSA
Top 10 Algorithms and Data Structures for Competitive Programming
Last Updated: 10 September 2024
In this post, we will discuss Important top 10 algorithms and data structures for competitive coding.Topics :Graph algorithmsDynamic program
...read more
GBlog
Competitive Programming
BFS
Segment-Tree
Binary Indexed Tree
sieve
Modular Arithmetic
DFS
Topological Sorting
BIT
number-theory
GBlog-Competitive-Programming
DSA
Primality Test | Set 3 (Miller–Rabin)
Last Updated: 14 November 2022
Given a number n, check if it is prime or not. We have introduced and discussed School and Fermat methods for primality testing.Primality Te
...read more
Mathematical
Modular Arithmetic
Prime Number
number-theory
DSA
Modular Exponentiation (Power in Modular Arithmetic)
Last Updated: 17 February 2025
Modular Exponentiation is the process of computing: xy (mod p). where x, y, and p are integers. It efficiently calculates the remainder
...read more
Google
Divide and Conquer
Mathematical
Modular Arithmetic
large-numbers
DSA
Modular multiplicative inverse
Last Updated: 11 October 2024
Given two integers A and M, find the modular multiplicative inverse of A under modulo M.The modular multiplicative inverse is an integer X s
...read more
Mathematical
Modular Arithmetic
Prime Number
number-theory
DSA
Euler's Totient Function
Last Updated: 24 February 2025
Euler's Totient function Φ(n) for an input n is the count of numbers in {1, 2, 3, ..., n-1} that are relatively prime to n, i.e., the numbe
...read more
Mathematical
GCD-LCM
sieve
Modular Arithmetic
Prime Number
Numbers
number-theory
euler-totient
DSA
Rabin-Karp Algorithm for Pattern Searching
Last Updated: 26 February 2025
Given a text T[0. . .n-1] and a pattern P[0. . .m-1], write a function search(char P[], char T[]) that prints all occurrences of P[] present
...read more
Pattern Searching
Modular Arithmetic
DSA
Nth Fibonacci Number
Last Updated: 15 April 2025
Given a positive integer n, the task is to find the nth Fibonacci number.The Fibonacci sequence is a sequence where the next term is the sum
...read more
Amazon
Snapdeal
MAQ Software
MakeMyTrip
Bloomberg
Dynamic Programming
Mathematical
Fibonacci
series
Modular Arithmetic
matrix-exponentiation
DSA
Write a program to reverse digits of a number
Last Updated: 19 March 2025
Given an Integer n, find the reverse of its digits.Examples:Input: n = 122Output: 221Explanation: By reversing the digits of number, number
...read more
MAQ Software
MakeMyTrip
Mathematical
number-digits
Modular Arithmetic
Recursion
DSA
Write program to calculate pow(b, e)
Last Updated: 27 January 2025
Given two numbers b and e, the task is to implement a function to compute b^e.Examples:Input: b = 3.00000, e = 5Output: 243.00000Input: b =
...read more
Microsoft
Amazon
MakeMyTrip
Divide and Conquer
Mathematical
Modular Arithmetic
maths-power
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !