# Tag Archives: Prime Number

## Print the nearest prime number formed by adding prime numbers to N

Given a number N. The task is to print the nearest prime if the number is not prime by making it prime by adding prime… Read More »

## Check if the given number K is enough to reach the end of an array

Given an array arr[] of n elements and a number K. The task is to determine if it is possible to reach the end of… Read More »

## Print all prime numbers less than or equal to N

Given a number N, the task is to print all prime numbers less than or equal to N. Examples: Input: 7 Output: 2, 3, 5,… Read More »

## Prime numbers in a given range using STL | Set 2

Generate all prime numbers between two given numbers. The task is to print prime numbers in that range. The Sieve of Eratosthenes is one of… Read More »

## Queries of nCr%p in O(1) time complexity

Given Q queries and P where P is a prime number, each query has two numbers N and R and the task is to calculate… Read More »

## Number which has the maximum number of distinct prime factors in the range M to N

Given two numbers M and N. The task is to print the number which has the maximum number of distinct prime factors of numbers in… Read More »

## Smarandache-Wellin Sequence

Given a number ‘n’, generate the first ‘n’ terms of the Smarandache-Wellin Sequence. The Smarandache-Wellin Sequence is a sequence formed by the Smarandache-Wellin numbers. Each… Read More »

## Program for Fibonacci numbers in PL/SQL

The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..… Read More »

## Prime Number of Set Bits in Binary Representation | Set 1

Given two integers ‘L’ and ‘R’, write a program to find the total numbers that are having prime number of set bits in their binary… Read More »

## Prime number in PL/SQL

Prerequisite – PL/SQL introduction A prime number is a whole number greater than 1, which is only divisible by 1 and itself. First few prime… Read More »

## Print prime numbers from 1 to N in reverse order

Given a number N, print all prime number smaller than or equal to N in reverse order . For example, if N is 9, the… Read More »

## Vantieghems Theorem for Primality Test

Vantieghems Theorem is a necessary and sufficient condition for a number to be prime. It states that for a natural number n to be prime,… Read More »

## Sub array sum is prime or not

Given an array and limits (lower and upper limits), check the sum of the subarray in the given limit is prime or not Examples :… Read More »

## Check a number for Permutable Prime

Given a number N, task is to Check whether it is a permutable prime number or not. A Permutable prime number is that number which… Read More »

## Blum Integer

Blum Integer is the number which only haves 2 factors suppose p and q (i.e. n = p * q), both are Semi-prime and also… Read More »