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

## Queries for counts of multiples in an array

Given an array of positive integers and many queries for divisibility. In every query, we are given an integer k ( > 0), we need… Read More »

## Count divisors of array multiplication

Given an array with N elements, task is to find the count of factors of a number X which is product of all array elements.… Read More »

## Efficient program to print the number of factors of n numbers

Given an array of integers. We are required to write a program to print the number of factors of every element of the given array.… Read More »

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

Given two integers ‘L’ and ‘R’, we need to write a program that finds the count of numbers having prime number of set bits in… Read More »

## Total number of divisors for a given number

Given a positive integer n, we have to find the total number of divisors for n. Examples: Input : n = 25 Output : 3… Read More »

## Maximum number of unique prime factors

Given a number N, find the maximum number of unique prime factors any number can have in range [1, N]. Examples: Input : N =… Read More »

## Amazon Interview Experience | Set 395 (On-campus for Internship)

Round 1: Total of 300 students participated in the notion of getting selected to do intern at Amazon. Round 1 had 20 MCQs and 2… Read More »

## Insert minimum number in array so that sum of array becomes prime

Given an array of n integers. Find minimum number to be inserted in array, so that sum of all elements of array becomes prime. If… Read More »

## Program to find sum of prime numbers between 1 to n

Write a program to find sum of all prime numbers between 1 to n. Examples: Input : 10 Output : 17 Explanation : Primes between… Read More »

## Find pair with maximum GCD in an array

We are given an array of positive integers. Find the pair in array with maximum GCD. Examples: Input : arr[] : { 1 2 3… Read More »

## Sum of all proper divisors of natural numbers in an array

Given an array of natural numbers count the sum of its proper divisors for every element in array. Input : int arr[] = {8, 13,… Read More »

## Numbers with exactly 3 divisors

Given a number N, print all numbers in range from 1 to N having exactly 3 divisors. Examples: Input : N = 16 Output :… Read More »

## Count of subarrays whose products don’t have any repeating prime factor

Given an array of integers. Find the total number of subarrays whose product of all elements doesn’t contain repeating prime factor in prime decomposition of… Read More »

## Optimized Euler Totient Function for Multiple Evaluations

Euler Totient Function (ETF) Φ(n) for an input n is count of numbers in {1, 2, 3, …, n} that are relatively prime to n,… Read More »