Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
Competitive Programming
3.3K+ articles
Strings
3.3K+ articles
Greedy
2.1K+ articles
number-digits
612+ articles
number-theory
424+ articles
Modular Arithmetic
207+ posts
Recent Articles
Popular Articles
Collatz Conjecture: Fun Facts and More
Last Updated: 20 May 2024
Collatz Conjecture or 3n + 1 Conjecture or Ulam Conjecture, is the problem in mathematics for almost a decade. It is proposed in 1937 by Lothar Collatz. Although extensive...
read more
Modular Arithmetic
Picked
Mathematics
CSES Solutions - Exponentiation II
Last Updated: 15 April 2024
Your task is to efficiently calculate values a^(b^c) modulo 109+7.Note that in this task we assume that 00 = 1.Examples:Input: N = 2, queries[][] = {{3, 7, 1}, {2, 3, 2}}O...
read more
Mathematical
Competitive Programming
Modular Arithmetic
Picked
DSA
Binary Exponentiation
CSES Problems
Modular Arithmetic for Competitive Programming
Last Updated: 09 March 2024
In mathematics, modular arithmetic refers to the arithmetic of integers that wraps around when a certain value is reached, called the modulus. This becomes particularly cr...
read more
Competitive Programming
Modular Arithmetic
Picked
Geeks Premier League
DSA
Geeks Premier League 2023
Binary Exponentiation for Competitive Programming
Last Updated: 14 May 2024
In competitive programming, we often need to do a lot of big number calculations fast. Binary exponentiation is like a super shortcut for doing powers and can make program...
read more
Competitive Programming
Modular Arithmetic
DSA
Binary Exponentiation
BPSK - Binary Phase Shift Keying
Last Updated: 17 April 2025
Binary Phase Shift Keying (BPSK) is a widely used modulation technique in digital communication systems for transmitting binary data over a communication channel. It is kn...
read more
Modular Arithmetic
GATE
Picked
General Electric
Electronics Engineering
Electrical Engineering
Minimizing numbers through subtraction operations
Last Updated: 07 November 2023
Given two numbers given as P and Q, the task is to make both numbers equal in the minimum number of operations, where you are allowed to perform the below operations any ...
read more
Mathematical
Modular Arithmetic
DSA
Count ways choosing K balls from any given A boxes
Last Updated: 18 February 2023
Given integers A and K, there are A boxes the first box contains K balls, the Second box contains K + 1 balls, the Third Box contains K + 3 balls so on till the A'th box c...
read more
Dynamic Programming
Combinatorial
Technical Scripter
Modular Arithmetic
Technical Scripter 2022
DSA
Count number of ways in which following people can be arranged
Last Updated: 10 February 2023
Given integers X and Y representing X girls and Y boys, the task is to count the number of ways arranging X girls and Y boys such that girls always stay together and two b...
read more
Combinatorial
Technical Scripter
Modular Arithmetic
Technical Scripter 2022
DSA
Minimize Array size by replacing adjacent integers by their Modulo
Last Updated: 15 May 2024
Given an array arr[] of positive integers of size N, the task is to find the minimum possible size of the array that can be obtained by replacing any two adjacent positive...
read more
Mathematical
Technical Scripter
Modular Arithmetic
frequency-counting
Technical Scripter 2022
DSA
Maximum multiple of a number with all digits same
Last Updated: 07 March 2024
Given two positive integers X and Y (1 ? Y ? 105), find the maximum positive multiple (say M) of X such that M is less than 10Y and all the digits in the decimal represent...
read more
Mathematical
Modular Arithmetic
DSA
Minimize distinct elements in Array after replacing arr[i] with arr[i] modulo X
Last Updated: 14 October 2022
Given an array arr[] of size N, the task is to minimize the number of distinct elements in the array after performing the following operation once:Choose an integer X and ...
read more
Arrays
Mathematical
GCD-LCM
Modular Arithmetic
DSA
12 hour clock Multiplication
Last Updated: 11 November 2022
Given two positive integers num1 and num2, the task is to find the product of the two numbers on a 12-hour clock rather than a number line.Note: Assume the Clock starts fr...
read more
Mathematical
Modular Arithmetic
School Programming
Picked
DSA
Count of Pairs such that modulo of product of one with their XOR and X is 1
Last Updated: 10 January 2023
Given two arrays A[] and B[] of length N and M respectively and a prime number X, the task is to find the number of ordered pair of indices (i, j) that satisfies the follo...
read more
Arrays
Mathematical
Bitwise-XOR
Modular Arithmetic
DSA
Find minimum and maximum number of terms to divide N as sum of 4 or 6
Last Updated: 02 August 2022
Given an integer N, the task is to find the minimum and the maximum number of terms required to divide N as the sum of 4 or 6.Examples:Input: N = 3Output: NOT POSSIBLEExpl...
read more
Greedy
Mathematical
Modular Arithmetic
DSA
Compute nCr % p | Set 4 (Chinese Remainder theorem with Lucas Theorem)
Last Updated: 30 November 2022
Given three numbers n, r and p, the task is to compute the value of nCr % p.Note: p is a square-free number and the largest prime factor of p ≤ 50.Examples:Input: n = 10, ...
read more
Mathematical
Modular Arithmetic
large-numbers
Permutation and Combination
DSA
1
2
3
4
...
14
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 !