Data Structure
Java
Python
HTML
Interview Preparation
Tutorials
Courses
Tracks
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Misc
7.7K+ articles
Mathematical
5.1K+ articles
Prime Number
615+ articles
number-digits
612+ articles
series
515+ articles
sieve
322+ articles
Modular Arithmetic
207+ articles
prime-factor
191+ articles
number-theory
424+ posts
Recent Articles
Popular Articles
Check for Prime Number
Last Updated: 11 October 2025
Given a number n, check whether it is a prime number or not.Note: A prime number is a number greater than 1 that has no positive divisors other than 1 and itself.Input: n ...
read more
Mathematical
DSA
Prime Number
number-theory
Number Theory in Mathematics
Last Updated: 23 July 2025
Number theory is one of the many branches of mathematics used to explore the intricate patterns and properties inherent in integers and their relationships. It helps us st...
read more
Picked
Mathematics
number-theory
CSES Solutions - Exponentiation
Last Updated: 23 July 2025
Your task is to efficiently calculate values a^b modulo 109+7. Note that in this task we assume that 00=1.Examples:Input: N = 3, queries[][] = {{3, 4}, {2, 8}, {123, 123}}...
read more
Competitive Programming
Picked
number-theory
Binary Exponentiation
CSES Problems
Beautiful Non Divisible Number
Last Updated: 23 July 2025
Given an integer N find an N digit positive number X such that GCD of X and any of its digit is not greater than 1. Print -1 if the answer does not exist.Examples:Input: N...
read more
Mathematical
DSA
GCD-LCM
number-theory
Counting numbers with given digits and digit sum
Last Updated: 23 July 2025
Given a number N, count the numbers X of length exactly N such that the number X and the sum of digits of the number X have digits A and B only in their decimal representa...
read more
Picked
DSA
number-theory
Binary Exponentiation
Number Theory for DSA & Competitive Programming
Last Updated: 23 July 2025
What is Number Theory?Number theory is a branch of pure mathematics that deals with the properties and relationships of numbers, particularly integers. It explores the fun...
read more
Competitive Programming
number-theory
Find triplet (A, B, C) such that LCM(A, B) + LCM(A, C) + LCM(B, C) equals N
Last Updated: 22 January 2024
Given an integer N. Find a triplet let say {A, B, C} such that LCM(A, B) + LCM(B, C) + LCM(A, C) = N. If no possible triplets are there, output -1 instead.Examples: Input:...
read more
Mathematical
Geeks Premier League
DSA
number-theory
QA - Placement Quizzes-Data Interpretation
Geeks Premier League 2023
Find out the maximum value of the expression according to the given constraint
Last Updated: 28 April 2025
Given an array A[] of length N. Then your task is to output the maximum value of (Sum/LCM). Where Sum is the addition of all the elements of A[] and LCM is a number betwee...
read more
Geeks Premier League
DSA
Arrays
number-theory
top-dsa-problems
Geeks Premier League 2023
Find the array B[] from A[] according to the given conditions
Last Updated: 11 January 2024
Given an array X[] of length N, having all elements less than or equal to M, the task is to print an array let's say Y[] of the same length following the given conditions:...
read more
DSA
GCD-LCM
math
Arrays
number-theory
DSA-Blogs
Geeks Premier League 2023
Find Maximum number of intersecting points with at most K distance
Last Updated: 23 July 2025
Two players A and B are standing at starting point 0 of an infinite horizontal line. Player A is given an array with jumpA[] of size M and Player B is given an array with ...
read more
Mathematical
Geeks Premier League
DSA
GCD-LCM
number-theory
Geeks Premier League 2023
Find minimum number K such that its factorial is multiple of N
Last Updated: 23 July 2025
Given an integer N. The task is to find minimum K such that the factorial of K is multiple of N. (2 ≤ N ≤ 1012)Examples:Input: N = 30Output: 5Explanation: 5! %...
read more
Searching
DSA
Binary Search
number-theory
Make elements of Array equal by repeatedly dividing elements by 2 or 3
Last Updated: 07 May 2023
Given an integer array A consisting of N integers. In one move, we can choose any index i ( 0 ≤ i ≤ N-1) and divide it either by 2 or 3(the number A[i] should be divisible...
read more
DSA
Arrays
Greedy Algorithms
number-theory
Maximum multiple of D from K-sized subset sums from given Array
Last Updated: 23 July 2025
Given an integer array A[] of size N and two integers K, D. A list or superset of all possible subset sums of size K is made from the given array, the task is to find the ...
read more
Dynamic Programming
DSA
Arrays
number-theory
Minimum difference between values in an array with factors 1 to M
Last Updated: 03 April 2023
Given an array of nums of length N and an integer M, the task is to find the minimum difference between two elements of nums such that the numbers coming between these two...
read more
Sorting
Mathematical
DSA
number-theory
Maths
Introduction to Möbius inversion
Last Updated: 24 March 2023
The Mobius inversion formula is a technique used in number theory to find the inverse of an arithmetic function. It is based on the Mobius function, which is a function th...
read more
Picked
Technical Scripter 2022
DSA
number-theory
1
2
3
4
...
29