## Sum of every K’th prime number in an array

Given an integer k and an array of integers arr (less than 10^6), the task is to find the sum of every k’th prime number… Read More »

- Sieve of Eratosthenes
- Top 10 Algorithms and Data Structures for Competitive Programming
- Efficient program to print all prime factors of a given number
- How to prepare for ACM - ICPC?
- Prime Numbers
- Prime Factorization using Sieve O(log n) for multiple queries
- Euler's Totient Function
- Find all divisors of a natural number | Set 1
- Segmented Sieve
- Sieve of Eratosthenes in 0(n) time complexity
- Find two prime numbers with given sum
- Print prime numbers in a given range using C++ STL
- Find all divisors of a natural number | Set 2
- Program to find sum of prime numbers between 1 to n
- k-Rough Number or k-Jagged Number
- Least prime factor of numbers till n
- Total number of divisors for a given number
- Frugal Number
- Sieve of Sundaram to print all primes smaller than n
- Nearest prime less than given number n
- Check if a number can be written as a sum of 'k' prime numbers
- Count Primes in Ranges
- Count Divisors of n in O(n^1/3)
- Compute n! under modulo p
- Efficient program to print the number of factors of n numbers
- Numbers with exactly 3 divisors
- k-th prime factor of a given number
- Print all prime factors and their powers
- Sieve of Atkin
- Smith Number

Given an integer k and an array of integers arr (less than 10^6), the task is to find the sum of every k’th prime number… Read More »

Given an integer . The task is to find the superpower from the factorization of . The Superpower is the highest power among the power… Read More »

Given an array arr[] of N positive integers. The task is to find the sum of all composite elements which are divisible by a given… Read More »

Given a singly linked list containing N nodes, the task is to find the total count of prime numbers. Examples: Input: List = 15 ->… Read More »

Given an array of integers. The task is to calculate the product of all the composite numbers in an array. Note: 1 is neither prime… Read More »

Given an array ‘arr’ of positive integers, the task is to count the number of composite numbers in the array. Note: 1 is neither Prime… Read More »

Given an array of integers arr[]. The task is to find the bitwise XOR of all the prime numbers present in the array. Examples: Input:… Read More »

Given an integer ‘k’ and an array of integers ‘arr’ (less than 10^6), the task is to find the product of every K’th prime number… Read More »

Given an positive integer N, calculate the product of the first N prime numbers. Examples: Input : N = 3 Output : 30 Explanation :… Read More »

Given a number . The task is to find the largest factor of that number which is a perfect square. Examples: Input : N =… Read More »

Given an array arr[] of N elements. The task is to find the maximum number of the contiguous prime numbers in the given array. Examples:… Read More »

Given a Number . The task is to check if N is a Trojan Number or not. Trojan Number is a number that is a… Read More »

Given an array arr[] of N positive integers. The task is to find the minimum and maximum prime elements in the given array. Examples: Input:… Read More »

Given an array of integers ‘arr’, the task is to sort all the prime numbers from the array in descending order in their relative positions… Read More »

Given a number N(1<=N<=109), the task is to find the total number of integers less than equal to n which have exactly 9 divisors. Examples:… Read More »