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

- Ternary number system or Base 3 numbers
- Find all divisors of first N natural numbers
- Find the largest composite number that divides N but is strictly lesser than N
- Check whether count of odd and even factors of a number are equal
- Split N natural numbers into two sets having GCD of their sums greater than 1
- Count of unique digits in a given number N
- Check if a number is Prime, Semi-Prime or Composite for very large numbers
- Split a number as sum of K numbers which are not divisible by K
- Transform N to Minimum possible value
- Sum of GCD of all numbers upto N with N itself
- Count of perfect squares of given length
- Program to Convert Octal to Hexadecimal
- Find two numbers whose difference of fourth power is equal to N
- Count of nodes having odd divisors in the given subtree for Q queries
- Largest number M less than N such that XOR of M and N is even
- Check if N can be expressed as product of 3 distinct numbers
- Sum of product of all subsets formed by only divisors of N
- Sum of Hamming difference of consecutive numbers from 0 to N | Set 2
- Determine whether the given integer N is a Peculiar Number or not
- Count of triplets in a given Array having GCD K
- Check if N can be obtained by repetitive addition or subtraction of two given numbers
- Check if all Prime factors of number N are unique or not
- Find K numbers with sum equal to N and sum of their squares maximized
- Sum of all divisors from 1 to N | Set 2
- Last digit in a power of 2
- Program to Convert BCD number into Decimal number
- Find pairs of elements from two different arrays whose product is a perfect square
- Find if it is possible to make all elements of an array equal by the given operations
- Count pairs in Array whose product is a Kth power of any positive integer
- Count all prime numbers in a given range whose sum of digits is also prime

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 »

Apart from Sieve of Eratosthenes method to generate Prime numbers, we can implement a new Algorithm for generating prime numbers from 1 to N. It… Read More »

There are two players P1 and P2 and two piles of coins consisting of M and N coins respectively. At each turn, a player can… Read More »

Given a number X and an array of N numbers. The task is to print all the numbers in the array whose set of prime… Read More »

Given a 3-digit number N, the task is to find if N is an Osiris number or not. Osiris numbers are the numbers that are… Read More »