# Tag Archives: Prime Number

Given two Geometric Progressions (a1, r1) and (a2, r2) where (x, y) represents GP with initial term x  and common ratio y and an integer… Read More
Given an integer array arr[] of N integers, the task is to make each adjacent pair in the array co prime, by adding minimum number of… Read More
Given a string S of size N consisting of digits [1, 9], the task is to find the length of the smallest subsequence in the… Read More
Given an array arr[] consisting of N distinct positive integers and a range [L, R], the task is to find the element in the given… Read More
Given an array arr[], the task is to find the longest subarray whose sum is a prime number. Examples: Input:   arr[ ] = {1, 4,… Read More
Given a number N, the task is to calculate the count of numbers of length N having prime numbers at odd indices and odd numbers… Read More
Given an integer N, find a prime number S such that all digits of N occur in a contiguous sequence. There may be multiple answers.… Read More
Given an array arr[] consisting of N positive integers, the task is to find the number of pairs such that the Greatest Common Divisor(GCD) of… Read More
Given a positive integer N, the task is to count the number of N-digit numbers which contain all single digit primes. Examples: Input: N =… Read More
Given a positive integer N, the task is to find the number of integers of N digits having even digits at odd indices and prime… Read More
Given an positive integer N, the task is to find the number of triplets (X, Y, Z) such that the sum of product of any… Read More
Given a string S consisting of N digits, the task is to find the number of distinct Prime Numbers that can be formed using the… Read More
Given a positive integer N, the task is to count the number of N-digit numbers whose sum of digits is a prime number. Examples: Input:… Read More
Given a positive integer N, the task is to generate a sequence say arr[] of maximum length having all elements at least 2 such that… Read More
Overview :An integer p>1 is called a prime number, or prime if the only positive divisors of p are 1 and p. An integer q>1… Read More