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

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

## A Kobayashi Maru Approach to Finding Primes

It has been said that “Great engineering strikes a balance between competing objectives.” I believe this to be true, in both mechanical and software engineering.… Read More »

## Recursive sum of digits of a number is prime or not

Given a number n, we need to find the sum of each digits of the number till the number becomes a single digit. We need… Read More »

## Pierpont Prime

A Pierpont Prime is a prime number of the form p = 2l.3k + 1. First few Pierpont prime numbers are 2, 3, 5, 7,… Read More »

## N expressed as sum of 4 prime numbers

Express a given number as a summation of 4 positive primes. If it is not possible to express then print “-1”. Examples: Input: 24 Output:… Read More »

## Check whether a number has exactly three distinct factors or not

Given a positive integer n(1 <= n <= 1018). Check whether a number has exactly three distinct factors or not. Print “Yes” if it has… Read More »

## Check whether a number is circular prime or not.

We are given a number n. Our task is to check whether the number is circular prime or not. Circular Prime : A prime number… Read More »

## Composite Number

A composite number is a positive integer that is not prime. In other words, it has a positive divisor other than one or itself. First… Read More »

## Primality Test | Set 3 (Miller–Rabin)

Given a number n, check if it is prime or not. We have introduced and discussed School and Fermat methods for primality testing. Primality Test… Read More »