## Sum of all numbers formed having 4 atmost X times, 5 atmost Y times and 6 atmost Z times

Given three integers X, Y and Z, the task is to find the sum of all the numbers formed having 4 atmost X times, 5… Read More »

## Size of the largest divisible subset in an Array

Given an array arr[] of size N. The task is to find the size of the set of numbers from the given array such that… Read More »

## Fermat’s Factorization Method

Fermat’s Factorization method is based on the representation of an odd integer as the difference of two squares. For an integer n, we want a… Read More »

## Goldbach’s Weak Conjecture for Odd numbers

Given an odd number N, the task is to find if the number can be represented as the sum of 3 prime numbers. Examples: Input:… Read More »

## Find the player who will win the Coin game

Given N coins, the task is to find who win the coin game. Coin game is a game in which each player picks coins from… Read More »

## Find the count of natural Hexadecimal numbers of size N

Given an integer N, the task is to find the count of natural Hexadecimal numbers with N digits. Examples: Input: N = 1 Output: 15… Read More »

## Largest Even and Odd N-digit numbers in Octal Number System

Given an integer N, the task is to find the largest even and odd N-digit numbers in Octal Number System. Examples: Input: N = 4… Read More »

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

## Program for Mobius Function | Set 2

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 »

## Count of all possible pairs of disjoint subsets of integers from 1 to N

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 »

## Nambiar Number Generator

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 »

## Program to find first N Fermat Numbers

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 »

## Modular Exponentiation of Complex Numbers

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 »

## Count non-negative triplets with sum equal to N

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 »

## Find a number containing N – 1 set bits at even positions from the right

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 »