## Find the number of pairs such that their gcd is equals to 1

Given an array a of size N. The task is to find the number of pairs such that gcd(a[i], a[j]) where 1 ≤ i <… Read More »

- New Algorithm to Generate Prime Numbers from 1 to Nth Number
- Predict the winner in Coin Game
- Find the Nth Mosaic number
- Count Distinct Rectangles in N*N Chessboard
- Check if each element of the given array is the product of exactly K prime numbers
- Modular Exponentiation of Complex Numbers
- Sum of all perfect numbers present in an array
- Number of ways of writing N as a sum of 4 squares
- Find a number containing N - 1 set bits at even positions from the right
- Print all numbers whose set of prime factors is a subset of the set of the prime factors of X
- Count non-negative triplets with sum equal to N
- Nambiar Number Generator
- Find the number of pairs such that their gcd is equals to 1
- Number of elements from the array which are reachable after performing given operations on D
- 3-digit Osiris number
- Program to find first N Fermat Numbers
- Program for Mobius Function | Set 2
- Count of all possible pairs of disjoint subsets of integers from 1 to N
- Dudeney Numbers
- Print first N Mosaic numbers

Given an array a of size N. The task is to find the number of pairs such that gcd(a[i], a[j]) where 1 ≤ i <… Read More »

Given an integer N. The task is to find Mobius function of all numbers from 1 to N. Examples: Input: N = 5 Output: 1… Read More »

Given an integer N. Consider the set of first N natural numbers A = {1, 2, 3, …, N}. Let M and P be two… Read More »

M. Nambiar has devised a mechanism to process any given number and thus generating a new resultant number. He calls this mechanism as the “Nambiar… Read More »

Fermat numbers are non-negative odd numbers which is valid for all values of k>=0. Only the first seven terms of the sequence are known till… Read More »

Given four integers A, B, K, M. The task is to find (A + iB)K % M which is a complex number too. A +… Read More »

Given an integer N. The task is to find the number of different ordered triplets(a, b, c) of non-negative integers such that a + b… Read More »

Given a positive integer N, the task is to find a number which contains (N – 1) set bits in its binary form at every… Read More »

Given an array arr[] and three integers D, A and B. You start with the number D and at any time you can add or… Read More »

Given an integer N, the task is to print first N Mosaic numbers. A Mosaic number can be expressed as follows: If N = p1a1p2a2…pkak… Read More »

Given a number N, the task is to find the number of ways of writing N as a sum of 4 squares. Two representations are… Read More »

Given an integer N, the task is to find the Nth Mosaic number. A Mosaic number can be expressed as follows: If N = Aa… Read More »

Given a N x N Chessboard. The task is to count distinct rectangles from the chessboard. For example, if the input is 8 then the… Read More »

Given an array arr[] containing N positive integer. The task is to find the sum of all the perfect numbers from the array. A number… Read More »

Given an array of numbers and the value of , check if each number can be expressed as the product of exactly prime numbers. For… Read More »