## Twin Prime Numbers between 1 and n

Given an integer n. we need to print all twin prime number pairs between 1 to n. A Twin prime are those numbers which are… Read More »

## Bertrand’s Postulate

In mathematics, Bertrand’s Postulate states that there is a prime number in the range to where n is a natural number and n >= 4.… Read More »

## Rosser’s Theorem

In mathematics, Rosser’s Theorem states that the nth prime number is greater than the product of n and natural logarithm of n for all n… Read More »

## Finding a Non Transitive Coprime Triplet in a Range

Given L and R, find a possible non transitive triplet (a, b, c) such that pair (a, b) is coprime and pair (b, c) is… Read More »

## Legendre’s Conjecture

It says that there is always one prime number between any two consecutive natural number’s(n = 1, 2, 3, 4, 5, …) square. This is… Read More »

## Inclusion Exclusion principle and programming applications

Sum Rule – If a task can be done in one of ways or one of ways, where none of the set of ways is… Read More »

## Product of unique prime factors of a number

Given a number n, we need to find the product of all of its unique prime factors. Prime factors: It is basically a factor of… Read More »

## Expressing factorial n as sum of consecutive numbers

Given two numbers N and M. Find the number of ways in which factorial N can be expressed as a sum of two or more… Read More »

## Find product of prime numbers between 1 to n

Given a number n, we need to find the product of all prime numbers between 1 to n. Examples: Input: 5 Output: 30 Explanation: product… Read More »

## Find n-th Fortunate Number

A Fortunate number is the smallest integer m > 1 such that, for a given positive integer n, pn + m is a prime number.… Read More »

## Lemoine’s Conjecture

Any odd integer greater than 5 can be expressed as a sum of an odd prime (all primes other than 2 are odd) and an… Read More »

## Largest number in [2, 3, .. n] which is co-prime with numbers in [2, 3, .. m]

Given two integers n and m, task is to find a number p which satisfy following conditions : -> The number p should be less… Read More »

## Prime numbers after prime P with sum S

Given three numbers sum S, prime P and N, find all N prime numbers after prime P such that their sum is equal to S.… Read More »

## Primality Test | Set 5(Using Lucas-Lehmer Series)

In this article we will discuss about Lucas-Lehmer series which is used to check primality of prime numbers of the form 2p – 1 where… Read More »

## Sum of largest divisible powers of p (a prime number) in a range

Given a range [L, R], and a prime number P. We are required to find the sum of the highest power of P in all… Read More »