##
Exactly n distinct prime factor numbers from a to b
November 4, 2016

You are given two numbers a and b (1 <= a,b <= 10^8 ) and n. The task is to find all numbers between a… Read More »

November 4, 2016

You are given two numbers a and b (1 <= a,b <= 10^8 ) and n. The task is to find all numbers between a… Read More »

October 26, 2016

Given a number n, find n’th smart number (1<=n<=1000). Smart number is a number which has at least three distinct prime factors. We are given… Read More »

October 12, 2016

Given a number n, print least prime factors of all numbers from 1 to n. The least prime factor of an integer n is the… Read More »

October 6, 2016

Given a number N, print all its unique prime factors and their powers in N. Input: N = 100 Output: Factor Power 2 2 5… Read More »

October 4, 2016

ACM ICPC(Association for Computing Machinery – International Collegiate Programming Contest) is a world-wide annual multi-tiered programming contest being organized for over thirteen years. The contest… Read More »

September 15, 2016

Given a number n, count total number of divisors of n!. Examples: Input : n = 4 Output: 24 4! is 24. Divisors of 24… Read More »

July 21, 2016

A palindromic prime (sometimes called a palprime) is a prime number that is also a palindromic number. Given a number n, print all palindromic primes… Read More »

June 25, 2016

Given a positive integer n, find the no of factors in n! where n

January 16, 2016

Given a limit, print all primes smaller than or equal to the given limit. Examples: Input: limit = 10 Output: 2, 3, 5, 7 Input:… Read More »

January 12, 2016

Given a number n, print all primes smaller than or equal to n. Examples: Input: n = 10 Output: 2, 3, 5, 7 Input: n… Read More »

December 16, 2015

Given a large number n and a prime p, how to efficiently compute n! % p? Examples: Input: n = 5, p = 13 Output:… Read More »

In this post “Important top 10 algorithms and data structures for competitive coding “. Topics : Graph algorithms Dynamic programming Searching and Sorting: Number theory… Read More »

November 24, 2015

Given a number n, print all primes smaller than n. For example, if the given number is 10, output 2, 3, 5, 7. Recommended: Please… Read More »

November 20, 2015

Given a range [low..high], print the smallest twin numbers in given range (low and high inclusive). Two numbers are twins if they are primes and… Read More »

November 14, 2015

Euler’s Totient function Φ(n) for an input n is count of numbers in {1, 2, 3, …, n} that are relatively prime to n, i.e.,… Read More »