# Tag Archives: number-theory

Given a number N, the task is to check whether N has 7 divisors or not. Examples: Input: 64Output: 1 Explanation: 1, 2, 4, 8, 16,… Read More
Given two numbers N and K. The task is to check whether N is Kth power to any integer i.e., whether N can be expressed… Read More
Given a Non-Negative integer N, denoting the first 2N positive integers where consecutive integers starting from 1 are paired with each other, the task is… Read More
Given a range [L, R] and an integer K, the task is to check if it is possible to make the GCD of all integers… Read More
Given an integer N, the task is to find the sum of all values of N after repeatedly dividing it with its smallest factor. Examples:… Read More
Given three integers L, R, and K. Consider an array arr[] consisting of all the elements from L to R, the task is to check… Read More
Given two integers P and Q, the task is to find any two integers whose Greatest Common Divisor(GCD) is P and the difference between their… Read More
Given an array arr[] consisting of n distinct positive integers. Find the length of the largest subset in the given array which sums to a… Read More
Given two positive integers N and K. The task is to find the Kth number that can be written as the sum of different non-negative… Read More
Number System is a method of representing numbers on the number line with the help of a set of symbols and rules. These symbols range… Read More
Given a positive integer N, the task is to generate N random hexadecimal integers. Examples: Input: N = 3Output:F9AD0D9E19B24CD01A5E   Approach: The given problem can… Read More
Given two integers N and K, the task is to find the number of different arrays of size N that can be formed having the… Read More
Given two Geometric Progressions (a1, r1) and (a2, r2) where (x, y) represents GP with initial term x  and common ratio y and an integer… Read More
Given three integers A, B, and C, the task is to find the minimum possible value of |A – X| + |B – Y| +… Read More
Given an array arr[] consisting of N integers and a positive integer X, the task is to count subsequences with GCD exactly X. Examples: Input:… Read More