## Program to find the Nth number of the series 2, 10, 24, 44, 70…..

Given a number N, the task is to find the Nth (N may be up to 10^18) term of this series: 2, 10, 24, 44,… Read More »

- Find minimum x such that (x % k) * (x / k) == n
- Count of pairs of (i, j) such that ((n % i) % j) % n is maximized
- Game of stones
- LCM of N numbers modulo M
- Split the number into N parts such that difference between the smallest and the largest part is minimum
- Minimum and Maximum element of an array which is divisible by a given number k
- Find last two digits of sum of N factorials
- GCD of a number raised to some power and another number
- Smallest odd digits number not less than N
- Value of the series (1^3 + 2^3 + 3^3 + ... + n^3) mod 4 for a given n
- Expressing a fraction as a natural number under modulo 'm'
- Implementation of Wilson Primality test
- Find the number of primitive roots modulo prime
- Program to find the Nth number of the series 2, 10, 24, 44, 70.....
- Numbers of Length N having digits A and B and whose sum of digits contain only digits A and B
- Sort elements of array whose modulo with K yields P

Given a number N, the task is to find the Nth (N may be up to 10^18) term of this series: 2, 10, 24, 44,… Read More »

Quotient – Remainder Sort is a non-comparison based sorting algorithm. Steps to perform Quotient – Remainder sort as described below : Find MIN and MAX… Read More »

Given a string of containing only L’s and R’s which represents left rotation and right rotation respectively. The task is to find the final direction… Read More »

Given two numbers a and n, the task is to find the single sum of digits of a^n (pow(a, n)). In single digit sum, we… Read More »

Given N questions and K options for each question, where and . The task is to determine sum of total number of player who has… Read More »

Given an integer N, the task is to find the maximum product of A, B, C, D such that below conditions satisfy: N%A ==0 &&… Read More »

Given two numbers and . The task is to find the sum of the sequence given below. (1*2*3*…*k) + (2*3*…*k*(k+1)) + (3*4*..*(k+1)*(k+2)) +…..+((n-k+1)*(n-k+2)*…*(n-k+k)). Since the… Read More »

Given a rectanglular floor of (M X N) meters is to be paved with square tiles of (s X s). The task is to find… Read More »

Given an integer N, the task is to print all the substring of N without doing any conversion i.e converting it into a string or… Read More »

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 »

Given a number N. The task is to find the number of unordered coprime pairs of integers from 1 to N. There can be multiple… Read More »

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 »

Given three numbers a, b and c, we need to find (ab) % c Now why do “% c” after exponentiation, because ab will be… Read More »

Given N, and ff(N) = f(1) + f(2) + …… + f(N), where f(k) is the sum of all subsets of a set formed by… Read More »

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