# Tag Archives: Prime Number

## Prime String

Given a String str , the task is to check if the sum of ASCII value of all characters is a Prime Number or not.… Read More »

## k-Rough Number or k-Jagged Number

A k-rough or k-jagged number is a number whose smallest prime factor is greater than or equal to the number ‘k’. Given numbers ‘n’ and… Read More »

## Check whether a number is Emirpimes or not

Given a number ‘n’, check whether it is an emirpimes or not. An emirpimes(“semiprime” when spelled backwards) derives its definition from the way it is… Read More »

## Number of primes in a subarray (with updates)

Given an array of N integers, the task is to perform the following two queries: query(start, end) : Print the number of prime numbers in… Read More »

## Number of prefix sum prime in given range query

Given an array of non-negative integers and range query l, r, find number of prefix sum which are prime numbers in that given range. Prerequisite… 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… Read More »

## 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 »