## Find sum of even factors of a number

Given a number n, the task is to find the even factor sum of a number. Examples: Input : 30 Output : 48 Even dividers… Read More »

## Find sum of odd factors of a number

Given a number n, the task is to find the odd factor sum. Examples : Input : n = 30 Output : 24 Odd dividers… Read More »

## Program for Mobius Function

Mobius Function is a multiplicative function which is used in combinatorics. It has one of three possible values -1, 0 and 1. Examples: Input :… Read More »

## Check whether a number is semiprime or not

Given a positive integer n. Find whether a number is a semiprime or not. Print True if number is semiprime else False. A semiprime is… Read More »

## Sum of all the factors of a number

Given a number n, the task is to find the sum of all the divisors. Examples : Input : n = 30 Output : 72… Read More »

## Sum of largest prime factor of each number less than equal to n

Given a non-negative integer n. The problem is to find the sum of the largest prime factor of each number less than equal to n.… Read More »

## Find largest prime factor of a number

Given a positive integer ‘n'( 1 <= n <= 1015). Find the largest prime factor of a number. Input: 6 Output: 3 Explanation Prime factor… Read More »

## K-Primes (Numbers with k prime factors) in a range

Given three integers A, B and K. We need to find no. of K-prime numbers in the range [A, B]. A number is called K-prime… Read More »

## Maximum factors formed by two numbers

Given a list of N numbers, Find two numbers such that the product of the two numbers has the maximum number of factors. Formally given… Read More »

## Prime factors of a big number

Given a number N, print all the prime factors and their powers. Here N <= 10^18 Examples : Input : 250 Output : 2 1… Read More »

## Number of steps to convert to prime factors

Given an array arr[] of n positive integers. Represent every number as its factors (x * y = arr[i]) [Here x or y cannot be… Read More »

## Largest power of k in n! (factorial) where k may not be prime

Given two numbers k and n, find the largest power of k that divides n! Constraints: K > 1 Examples: Input : n = 7,… Read More »

## Queries to find whether a number has exactly four distinct factors or not

Given a positive integers ‘q’ and ‘n’. For each query ‘q’ find whether a number ‘n’ have exactly four distinct divisors or not. If the… Read More »

## Lucas Primality Test

A number p greater than one is prime if and only if the only divisors of p are 1 and p. First few prime numbers… Read More »

## Check if a number is divisible by all prime divisors of another number

Given two integers. We need to find if the first number x is divisible by all prime divisors of y. Examples : Input : x… Read More »