# Category Archives: Mathematical

## 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 = 4… 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 Output:… 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 »

## Delannoy Number

In mathematics, a Delannoy number D describes the number of paths from the southwest corner (0, 0) of a rectangular grid to the northeast corner… Read More »

## Number of triangles after N moves

Find the number of triangles in Nth step, Rules: Draw an equilateral triangle at the start. In the i-th move, take the uncolored triangles, divides… Read More »

## Express an odd number as sum of prime numbers

Given an odd number, we need to express it as the sum of at most three prime numbers. Examples: Input : 27 Output : 27… Read More »

## Maximum value with the choice of either dividing or considering as it is

We are given a number n, we need to find the maximum sum possible with the help of following function: F(n) = max( (F(n/2) +… Read More »

## Check if a number is Full Prime

A full prime number is one in which the number itself is prime and all its digits are also prime. Given a number n, check… Read More »

## Count rotations divisible by 8

Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples: Input: 8 Output: 1 Input:… Read More »

## AKS Primality Test

There are several primality test available to check whether the number is prime or not like Fermat’s Theorem, Miller-Rabin Primality test and alot more. But… Read More »

## Motzkin number

In mathematics, a Motzkin number for a given number n is the number of different ways of drawing non-intersecting chords between n points on a… Read More »