## Count unset bits in a range

Given a non-negative number n and two values l and r. The problem is to count the number of unset bits in the range l… Read More »

## Midy’s theorem

According to Midy’s theorem, if the period of a repeating decimal for , where p is prime and is a reduced fraction, has an even… Read More »

## Program to compute division upto n decimal places

Given 3 numbers x, y and n compute the division (x/y) upto n decimal places. Examples : Input : x = 22, y = 7,… Read More »

## Program to check if tank will overflow, underflow or filled in given time

Given a tank with definite height and radius and the flow of water available to fill the tank. Determine whether the tank will overflow or… Read More »

## Sum of fourth power of first n even natural numbers

Write a program to find the sum of fourth power of first n even natural numbers. 24 + 44 + 64 + 84 + 104… Read More »

## Balanced Prime

In number theory, a Balanced Prime is a prime number with equal-sized prime gaps above and below it, so that it is equal to the… Read More »

## Newman–Shanks–Williams prime

In mathematics, a Newman–Shanks–Williams prime (NSW prime) is a prime number p which can be written in the form: Recurrence relation for Newman–Shanks–Williams prime is:… Read More »

## Maximize volume of cuboid with given sum of sides

We are given the sum of length, breadth and height, say S, of a cuboid. The task is to find the maximum volume that can… Read More »

## Smallest integer which has n factors or more

Given n, find the smallest integer which has n factors or more. It may be assumed that the result is less than 1000001. Examples: Input… Read More »

## Program to determine the quadrant of the cartesian plane

Given co-ordinates (x, y), determine the quadrant of the cartesian plane. Image_source : wikipedia.org Examples : Input : x = 1, y = 1 Output… Read More »

## Sum of squares of first n natural numbers

Given a positive integer N. The task is to find 12 + 22 + 32 + ….. + N2. Examples : Input : N =… Read More »

## Count numbers with unit digit k in given range

Here given a range from low to high and given a number k.You have to find out the number of count which a number has… Read More »

## Break a number such that sum of maximum divisors of all parts is minimum

We need to split a number n such that sum of maximum divisors of all the parts is minimum. Examples : Input: n = 27… Read More »

## Find first and last digits of a number

Given a number and to find first and last digit of a number. Examples: Input : 12345 Output : First digit: 1 last digit :… Read More »

## N-th polite number

A polite number is a positive integer that can be written as the sum of two or more consecutive positive integers. Given N, find the… Read More »