Compositorial of a number
Given a natural number N, the task is to find the Nth compositorial number....
read more
Ordered Prime Signature
Given a number n, find the ordered prime signatures and using this find the number of divisor of given n. Any positive integer, ‘n’ can be expressed in the form of its prime factors. If ‘n’ has p1, p2, … etc. as its prime factors, then n can be expressed as : Now, arrange the obtained exponents of the prime factors of ‘n’ in non-decreasing order. The arrangement thus obtained is called the ordered prime signature of the positive integer ‘n’.Example:...
read more
Total number Of valid Home delivery arrangements
Given the number of orders, find the number of valid arrangements of orders where delivery of ith order is always after the pickup of ith order....
read more
Sum of array elements which are prime factors of a given number
Given an array arr[] of size N and a positive integer K, the task is to find the sum of all array elements which are prime factors of K....
read more
Recursive Program to find Factorial of a large number
Given a large number N, the task is to find the factorial of N using recursion....
read more
Factorial of a number without using multiplication
Given a positive number N, the task is to calculate the factorial of N without using the multiplication operator....
read more
Weird Number
In number theory, a weird number is a natural number that is abundant but not semiperfect. In other words, the sum of the proper divisors (divisors including 1 but not itself) of the number is greater than the number, but no subset of those divisors sums to the number itself. Given a number N, the task is to check if the number is weird or not....
read more
Count all pairs of divisors of a number N whose sum is coprime with N
Given an integer N, the task is to count all pairs of divisors of N such that the sum of each pair is coprime with N.Examples:...
read more
Count of pairs in an array such that the highest power of 2 that divides their product is 1
Given an array arr[] of N positive integers. The task is to find the count of pairs (arr[i], arr[j]) such that the maximum power of 2 that divides arr[i] * arr[j] is 1.Examples:...
read more
Factors of 18
Factors of 18 are 1, 2, 3, 6, 9 and 18. The factors of a number give back the original number when multiplied in pairs. Generally, the factors of the number are the number that divides the original number completely. The number 18 is composite because it has more factors other than 1 and the number itself....
read more
Factors of 40
Factors of 40 are 1, 2, 4, 5, 8, 10, 20, and 40 itself. These numbers can be multiplied together in a defined pair to yield the number 40 or divide the 40 individually without leaving any remainder. When a number is factorized, it is expressed as the product of its factors. In the case of 40, this might be 2 × 20. When a number is expressed using the Division Method, it is expressed into a division pattern; in this case, it could be 40 ÷ 2 = 20....
read more
Absolute difference between the count of odd and even factors of N
Given a positive integer N, the task is to find the absolute difference of the count of odd and even factors of N....
read more