# Category Archives: Mathematical

## Recursive sum of digits of a number is prime or notNovember 3, 2017

Given a number n, we need to find the sum of each digits of the number till the number becomes a single digit. We need… Read More »

## Find n-th term in the series 7, 15, 32, …

Given a series 7, 15, 32, …… Find the nth term of this series. Examples : Input : 5 Output : 138 Input : 7… Read More »

## Check if given number can be represented as sum of two great numbers

We are given a number N. We need to check if the given number N can be represented as sum of two Great numbers. If… Read More »

## Find n-th term in sequence 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, ….

Consider the infinite sequence of integers: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5…. The sequence is built… Read More »

## Number of co-prime pairs in an arrayNovember 2, 2017

Co-prime or mutually prime pair are those pair of numbers whose GCD is 1. Given an array of size n, find number of Co-Prime or… Read More »

## Check if a large number is divisibility by 15

Given a very large number. Check its divisibility by 15. Examples: Input: 31 Output: No Input : num = “156457463274623847239840239 402394085458848462385346236 482374823647643742374523747 264723762374620” Output: Yes… Read More »

## Double Base PalindromeNovember 1, 2017

Double base Palindrome as the name suggest is a number which is Palindrome in 2 bases. One of the base is 10 i.e. decimal and… Read More »

## Program to find correlation coefficientOctober 31, 2017

Given two array elements and we have to find the correlation coefficient between two array. Correlation coefficient is an equation that is used to determine… Read More »

## Find the number of spectators standing in the stadium at time t

There are n spectators in the stadium, labeled from 1 to n. At time 1, the first spectator stands. At time 2, the second spectator… Read More »

## Program for weighted mean of natural numbers.

There are given an array of natural numbers and another array with corresponding weight of the number. Then we have to calculate the weighted mean.… Read More »

## Biggest integer which has maximum digit sum in range from 1 to n

Given a number n, find a number in range from 1 to n such that its sum is maximum. If there are several such integers,… Read More »

## Find n-th term in the series 9, 33, 73,129 …October 30, 2017

Given a series 9, 33, 73, 129… Find the n-th term of the series. Examples: Input : n = 4 Output : 129 Input :… Read More »

## Program to find GCD of floating point numbersOctober 29, 2017

The greatest common divisor (GCD) of two or more numbers, which are not all zero, is the largest positive number that divides each of the… Read More »

## Mathematics | Graph theory practice questions

Problem 1 – There are 25 telephones in Geeksland. Is it possible to connect them with wires so that each telephone is connected with exactly… Read More »

## Program for harmonic mean of numbersOctober 28, 2017

Given an array of elements, find harmonic mean of numbers. Examples: Input : arr[] = {2.0, 1.0} Output : 1.3333 Harmonic mean = 2/(1/2.0 +… Read More »