# Tag Archives: number-theory

## Count of all N digit numbers such that num + Rev(num) = 10^N – 1

Given an integer N, the task is to find the count of all N digit numbers such that num + Rev(num) = 10N – 1… Read More »

## Print n numbers such that their sum is a perfect square

Given an integer n, the task is to print n numbers such that their sum is a perfect square. Examples: Input: n = 3 Output:… Read More »

## Number of trailing zeroes in base B representation of N!

Given two positive integers B and N. The task is to find the number of trailing zeroes in b-ary (base B) representation of N! (factorial… Read More »

## Split the array into odd number of segments of odd lengths

Given an array of n length. The task is to check if the given array can be split into an odd number of sub-segment starting… Read More »

## Count primes that can be expressed as sum of two consecutive primes and 1

Given a number N. The task is to count the number of prime numbers from 2 to N that can be expressed as a sum… Read More »

## Find a permutation of 2N numbers such that the result of given expression is exactly 2K

Given two integers N and K, the task is to find a permutation of first 2*N natural numbers such that the following equation is satisfied.… Read More »

## Numbers less than N that are perfect cubes and the sum of their digits reduced to a single digit is 1

Given a number n, the task is to print all the numbers less than or equal to n which are perfect cubes as well as… Read More »

## Find maximum operations to reduce N to 1

Given two numbers A and B ( A and B can be up to 106 ) which forms a number N = (A!/B!). The task… Read More »

## Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B

Given three positive integers N, A and B. The task is to count the numbers of length N containing only digits A and B and… Read More »

## Make all numbers of an array equal

Given an array arr[], the task is to make all the array elements equal with the given operation. In a single operation, any element of… Read More »

## Count Odd and Even numbers in a range from L to R

Given two numbers L and R, the task is to count the number of odd numbers in the range L to R. Examples: Input: l… Read More »

## Closest sum partition (into two subsets) of numbers from 1 to n

Given an integer sequence 1, 2, 3, 4, …, n. The task is to divide it into two sets A and B in such a… Read More »

## Count of Numbers such that difference between the number and sum of its digits not less than L

Given a Natural number N and a whole number L, the task is to find the count of numbers, smaller than or equal to N,… Read More »

## Minimum multiplications with {2, 3, 7} to make two numbers equal

Given two numbers A and B, the task is to find the minimum number of operations required to make A and B equal. In each… Read More »

## Check whether a number is Non-hypotenuse number

Given a positive integer n, the task is to check if n is a Non-hypotenuse number or not. If n is a Non-hypotenuse number then… Read More »