# Category Archives: Algorithms

## Removing a number from array to make it Geometric Progression

Given an array arr[] of N positive elements, the task is to find whether it is possible to convert this array into Geometric Progression (GP)… Read More »

## Count numbers which can be constructed using two numbers

Given three positive integers x, y and n, the task is to find count of all numbers from 1 to n that can be formed… Read More »

## Emirp numbers

Emirp is the word “prime” spelled backwards, and it refers to a prime number that becomes a new prime number when you reverse its digits.… Read More »

## Abundant Number

A number n is said to be Abundant Number if sum of all the proper divisors of the number denoted by sum(n) is greater than… Read More »

## Minimum number of swaps required to sort an array

Given an array of n distinct elements, find the minimum number of swaps required to sort the array. Examples: Input : {4, 3, 2, 1}… Read More »

## Hexagonal Number

Given an integer n, the task is to find the nth hexagonal number . The nth hexagonal number Hn is the number of distinct dots… Read More »

## Maximum sum of distinct numbers with LCM as N

Given a number N, the task is to find out maximum sum of distinct numbers such that the Least Common Multiple of all these numbers… Read More »

## Powerful Number

A number n is said to be Powerful Number if for every prime factor p of it, p2 also divides it. For example:- 36 is… Read More »

## Time Complexity of a Loop when Loop variable “Expands or Shrinks” exponentially

For such cases, time complexity of the loop is O(log(log(n))).The following cases analyse different aspects of the problem. Case 1 : filter_none edit close play_arrow… Read More »

Padovan Sequence similar to Fibonacci sequence with similar recursive structure. The recursive formula is, P(n) = P(n-2) + P(n-3) P(0) = P(1) = P(2) =… Read More »

## Maximum sum of pairs with specific difference

Given an array of integers and a number k. We can pair two number of array if difference between them is strictly less than k.… Read More »

## Juggler Sequence

Juggler Sequence is a series of integer number in which the first term starts with a positive integer number a and the remaining terms are… Read More »

## Count all pairs with given XOR

Given an array of distinct positive integers and a number x, find the number of pairs of integers in the array whose XOR is equal… Read More »

## Deficient Number

A number n is said to be Deficient Number if sum of all the divisors of the number denoted by divisorsSum(n) is less than twice… Read More »