# Category Archives: Algorithm

## Divisible by 37 for large numbersOctober 23, 2017

Given a large number n, we need to check whether it is divisible by 37. Print true if it is divisible by 37 otherwise False.… Read More »

## Median after K additional integers

Given an array of n integers. We are allowed to add k additional integer in the array and then find the median of the resultant… Read More »

## Armstrong Numbers between two integers

A positive integer with digits a, b, c, d… is called an Armstrong number of order n if following condition is satisfied. abcd… = an… Read More »

## Random Walk (Implementation in Python)October 22, 2017

Introduction A random walk is a mathematical object, known as a stochastic or random process, that describes a path that consists of a succession of… Read More »

## Lucas Primality Test

A number p greater than one is prime if and only if the only divisors of p are 1 and p. First few prime numbers… Read More »

## Pair with maximum GCD from two arrays

Given two arrays of n integers with values of array being small (values never exceed a small number say 100). Find the pair(x, y) which… Read More »

## Program to find compound interest

What is ‘Compound interest’? Compound interest is the addition of interest to the principal sum of a loan or deposit, or in other words, interest… Read More »

## Tau – A Mathematical Constant

What is Tau? The constant is numerically equal to 2*pi (2 times pi), and with value approximately 6.28. The ratio equates to 2*C/D. Where C… Read More »

## Given a HUGE number check if it’s a power of two.October 21, 2017

Find if a given number, num is power of 2 or not. More specifically, find if given number can be expressed as 2^k where k… Read More »

## Find One’s Complement of an Integer

Given an integer n, find the one’s complement of the integer. Examples: Input : n = 5 Output : 2 Input : n = 255… Read More »

## Interquartile Range (IQR)October 20, 2017

The quartiles of a ranked set of data values are three points which divide the data into exactly four equal parts, each part comprising of… Read More »

## Time complexity of recursive Fibonacci program

The Fibonacci numbers are the numbers in the following integer sequence 0, 1, 1, 2, 3, 5, 8, 13… Mathematically Fibonacci numbers can be written… Read More »

## Secretary Problem (A Optimal Stopping Problem)

The Secretary Problem also known as marriage problem, the sultan’s dowry problem, and the best choice problem is an example of Optimal Stopping Problem. This… Read More »

## Pierpont Prime

A Pierpont Prime is a prime number of the form p = 2l.3k + 1. First few Pierpont prime numbers are 2, 3, 5, 7,… Read More »

## Woodall Number

A Woodall number is of the form: Wn = n.2n – 1 The first few Woodall numbers are: 1, 7, 23, 63, 159, 383, 895……… Read More »