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
Prime Number
615+ articles
number-theory
424+ articles
sieve
322+ articles
prime-factor
191+ articles
divisors
147+ posts
Recent Articles
Popular Articles
Count of squads of positive integers such that (A * B) + (C * D) = N
Last Updated: 01 October 2023
Given a positive integer N, the task is to find the count of squads of positive integers (A, B, C, D) such that (A * B) + (C * D) = N.Note: (A, B, C, D) is different from ...
read more
Mathematical
permutation
divisors
DSA
Minimize Y for given N to minimize difference between LCM and GCD
Last Updated: 19 December 2022
Given an integer N, the task is to find a minimum possible Y that satisfies the following condition:Y N.Y is not divisible by N (except N = 1).The absolute difference of ...
read more
Mathematical
Technical Scripter
GCD-LCM
Prime Number
divisors
DSA
Check presence of integer between min and max of Array that divide all Array elements
Last Updated: 24 August 2022
Given an array A[] of size N, the task is to check if there exists any integer that divide all the elements of that array and lies in the range of minimum and maximum elem...
read more
Arrays
Greedy
divisors
DSA
Number of distinct GCD by adding same number with given two integers
Last Updated: 03 August 2022
Given two positive integers N and M, the task is to find the number of different GCDs which can be formed by adding an integer K to both N and M, where K ≥ 0.Examples:Inpu...
read more
Mathematical
GCD-LCM
divisors
DSA
Minimum divisions to reduce N to 1 by following given conditions
Last Updated: 19 May 2022
Given an integer N, the task is to find the minimum number of divisions required to reduce the number to 1 when the divisions follow the given criteria:Pick two integers X...
read more
Mathematical
divisors
DSA
Construct longest Array starting with N and A[i] as multiple of A[i+1]
Last Updated: 21 February 2023
Given an integer N, the task is to construct the longest possible array A[], such that the following conditions hold:A[0] = N.No two adjacent elements should be equal.For ...
read more
Arrays
Pattern Searching
Mathematical
divisors
DSA
Count of numbers up to N having only 4 factors or divisors
Last Updated: 17 December 2023
Given an integer N, find the number of natural numbers less than or equal to N and have 4 factors.Example:Input: N = 8Output: 2Explanation: {1} is divisor set of 1{1, 2} i...
read more
Mathematical
divisors
Geeks-Premier-League-2022
Geeks Premier League
DSA
Generate Array such that max is minimized and arr[i] != arr[j] when j is a multiple of i
Last Updated: 01 February 2023
Given an integer N, the task is to generate an array arr[] having N positive integers such that arr[i] ≠ arr[j] if j is divisible by i (1-based indexing is considered) suc...
read more
Arrays
Mathematical
sieve
divisors
Geeks-Premier-League-2022
Geeks Premier League
DSA
Minimize operations to reduce N to 0 by replacing N by its divisor at each step
Last Updated: 04 May 2022
Given a positive integer N. Find the minimum number of operations needed to reduce N to 0 when N can reduced by its divisor at each operation.Example:Input: N = 5Output: 4...
read more
Greedy
Mathematical
sieve
divisors
Geeks-Premier-League-2022
Geeks Premier League
DSA
Find a triplet (X, Y, Z) such that all are divisible by A, exactly one is divisible by both A and B, and X + Y = Z
Last Updated: 09 February 2022
Given two integers A and B, the task is to find a triplet (X, Y, Z) such that all of them are divisible by A, exactly one of them is divisible by both A and B, and X + Y =...
read more
Mathematical
Combinatorial
divisors
Pigeonhole Principle
DSA
Smallest number having only 4 divisors with difference between any two at most D
Last Updated: 16 February 2022
Given the number D, find the smallest number N such that it has exactly four divisors and the difference between any two of them is greater than or equal to D.Examples:Inp...
read more
Arrays
Mathematical
divisors
Algo Geek
Algo-Geek 2021
DSA
Minimum moves to make M and N equal by repeated addition of divisors except 1 using Dynamic Programming
Last Updated: 28 November 2022
Given two integers N and M, the task is to calculate the minimum number of moves to change N to M, where In one move it is allowed to add any divisor of the current value ...
read more
Arrays
Graph
Dynamic Programming
Mathematical
divisors
DSA
Minimum operations to reduce N to a prime number by subtracting with its highest divisor
Last Updated: 26 October 2021
Given a positive integer N. In one operation subtract N with its highest divisor other than N and 1. The task is to find minimum operations required to reduce N exactly to...
read more
Mathematical
Prime Number
Game Theory
divisors
DSA
Count triplets such that product of two numbers added with third number is N
Last Updated: 11 October 2021
Given a positive integer N, the task is to find the number of triplets (A, B, C) where A, B, C are positive integers such that the product of two numbers added with the th...
read more
Mathematical
divisors
DSA
Height of Factor Tree for a given number
Last Updated: 08 August 2022
Given a positive integer N, the task is to find the height of the Factor Tree of the given integer N.Examples:Input: N = 20Output: 3Explanation: The height of the Factor T...
read more
Tree
Algorithms
Dynamic Programming
Mathematical
C++
divisors
factor
DSA
1
2
3
4
...
10
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 !