# Category Archives: Mathematical

## Find n-th element in a series with only 2 digits (4 and 7) allowedJune 4, 2017

Consider a series of numbers composed of only digits 4 and 7. First few numbers in the series are 4, 7, 44, 47, 74, 44744,..… Read More »

## Maximum sum of distinct numbers such that LCM of these numbers is N

Given a positive number N. The task is to find maximum sum of distinct numbers such that the LCM of all these numbers is equal… Read More »

## Perfect cubes in a rangeJune 3, 2017

Given two given numbers a and b where 1 <= a <= b, find perfect cubes between a and b (a and b inclusive). Examples:… Read More »

## Square root of a number using logJune 2, 2017

For a given number find the square root using log function. Number may be int, float or double. Examples: Input : n = 9 Output… Read More »

## Maximum value of an integer for which factorial can be calculated on a machineMay 31, 2017

Program to find maximum value of an integer for which factorial can be calculated on a machine, assuming that factorial is stored using basic data… Read More »

## Check if LCM of array elements is divisible by a prime number or notMay 30, 2017

Given an array and a number k, the task is to find if LCM of the array is divisible by k or not. Examples: Input… Read More »

## Find the closest and smaller tidy numberMay 28, 2017

Tidy Number are those number whose digits are arranged in non-decreasing order. Here, we are given a number and we have to find another number… Read More »

## Convert a binary number to hexadecimal number

The problem is to convert the given binary number to its equivalent hexadecimal number. The input could be very large and may not fit even… Read More »

## Count of m digit integers that are divisible by an integer nMay 27, 2017

Given two numbers m and n, count number of m digit numbers that are divisible by n. Examples: Input : m = 2 n =… Read More »

## Biggest number by arranging numbers in certain order

Given an array of n numbers. Arrange them in a way that yields the largest value. While arranging the order of even numbers with respect… Read More »

## Find the n-th number made of even digits only

Given a number n, find out the n-th positive number made up of even digits (0, 2, 4, 6, 8) only. Firs few numbers made… Read More »

## Converting a Real Number (between 0 and 1) to Binary StringMay 26, 2017

Given a real number between 0 and 1 (e.g., 0.72) that is passed in as a double, print the binary representation. If the number cannot… Read More »

## Queries for GCD of all numbers of an array except elements in a given range

Given an array of n numbers and a number of queries are also given. Each query will be represented by two integers l, r. The… Read More »

## An efficient way to check whether n-th Fibonacci number is multiple of 10May 24, 2017

We are given a variable n, we need to find whether Fibonacci number will be multiple of 10 or not. Examples: Input : 15 Output… Read More »

## Fizz Buzz ImplementationMay 23, 2017

Fizz Buzz is a very simple programming task, asked in software developer job interviews. A typical round of Fizz Buzz can be: Write a program… Read More »