# Tag Archives: math

## Modulo power for large numbers represented as strings

Given two numbers sa and sb represented as strings, find ab % MOD where MOD is 1e9 + 7. The numbers a and b can… Read More »

## Find First element in AP which is multiple of given prime

Given the first term (A) and common difference (D) of an Arithmetic Progression, and a prime number (P). The task is to find the position… Read More »

## Maximum possible intersection by moving centers of line segments

Given three points on the X-axis which denotes the center of three line segments. The length of the line segment is also given as L.… Read More »

## 10’s Complement of a decimal number

Given a decimal number N. The task is to find 10’s complement of the number N. Example: Input : 25 Output : 10’s complement is… Read More »

## Number of N digit integers with weight W

Given N, the number of digits of an integer which is greater than or equal to 2 and a weight W. The task is to… Read More »

## Number of integral solutions for equation x = b*(sumofdigits(x)^a)+c

Given a, b and c which are part of the equation x = b * ( sumdigits(x) ^ a ) + c. Where sumdigits(x) determines… Read More »

## Length and Breadth of rectangle such that ratio of Area to diagonal^2 is maximum

Given an array of positive integers. The task is to choose a pair of elements from the given array such that they represent the length… Read More »

## Count number of right triangles possible with a given perimeter

Given a perimeter P, the task is to find the number of right triangles possible with perimeter equal to p. Examples: Input: P = 12… Read More »

## Sudo Placement[1.7] | Greatest Digital Root

Given a number N, you need to find a divisor of N such that the Digital Root of that divisor is the greatest among all… Read More »

## Program to find last two digits of 2^n

Given a number n, we need to find the last two digits of 2n. Examples: Input : n = 7 Output : 28 Input :… Read More »

## Largest number with maximum trailing nines which is less than N and greater than N-D

Given two numbers N and D. The task is to find out the largest number smaller than or equal to N which contains the maximum… Read More »

## Distance between two parallel Planes in 3-D

You are given two planes P1: a1 * x + b1 * y + c1 * z + d1 = 0 and P2: a2 *… Read More »

## Probability that the pieces of a broken stick form a n sided polygon

We have a stick of length L. The stick got broken at (n-1) randomly chosen points (lengths of parts can be non-integer or floating point… Read More »

## Sum of series till N-th term whose i-th term is i^k – (i-1)^k

Given value of N and K. The task is to find the sum of series till N-th term whose i-th term is given by Ti… Read More »

## Haversine formula to find distance between two points on a sphere

The Haversine formula calculates the shortest distance between two points on a sphere using their latitudes and longitudes measured along the surface. It is important… Read More »