×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

List of Mathematical Algorithms

This is the ultimate list of Mathematical Algorithms. These are algorithms that utilize insightful mathematical ideas at its core.

Algorithms

Algorithm to find the maximum power of N that divides M factorial (M!)

We are given two numbers M and N. Our aim is to find the highest power of N that divides Factorial of M (M!). First we have discussed about the Brute Force approach and then we will be discussing this problem using Legendre’s formula.

Shivani Rajput Shivani Rajput
Algorithms

Kadane's Algorithm for largest subarray sum

Kadane's Algorithm is commonly known for Finding the largest sum of a subarray in linear time O(N). We have presented 3 variants of Kadane's Algorithm along with in-depth explanation of basic ideas.

Raksha Jain
Algorithms

Binary GCD Algorithm

Binary GCD algorithm or Stein's algorithm is an algorithm that calculates two non-negative integer's largest common divisor by using simpler arithmetic operations than the standard euclidean algorithm and it reinstates division by numerical shifts, comparisons, and subtraction operations.

Simrann Arora Simrann Arora
Algorithms

Minimum number of operations to make GCD of an array K

We are given an array and we need to find the minimum number of operations required to make GCD of the array equal to k. Where an operation could be either increment or decrement an array element by 1. We have solved this in O(N log N) time complexity.

Shweta Bhardwaj
Algorithms

Minimum number of increment (by 1) operations to make array in increasing order

Given an array of size N . Find the number of increment (by 1) operations required to make the array in increasing order. In each move, we can add 1 to any element in the array.

Sweta Behera
Algorithms

Find Maximum Perimeter of a Triangle

Given an array of integers, find which three elements form a non-degenerate triangle such that the triangle has maximum perimeter. This can be done using a Greedy algorithm by sorting the array of integers.

Nikita Masand Nikita Masand
Algorithms

Make N numbers equal by incrementing N-1 numbers

Given an array, find the minimum number of operations to make all the array elements equal. The operation includes incrementing all but one element of the array by 1.

Nikita Masand Nikita Masand
Algorithms

Finding all Armstrong Numbers in a given range

In this article, we will develop an approach to find all armstrong numbers in a given range. The approach is to check for each number in the range if it is an armstrong number or not.

SRISTI DAKSHIT
Algorithms

Split a number into K unique parts such that their GCD is maximum

The problem is to split a number N into K unique parts such that the sum of the parts is equal to N and the greatest common divisor of the K parts is maximum. This can be solved in O(N^1/2) time complexity using a greedy approach.

Sushil Sarwade
Algorithms

Pairs whose sum is divisible by a given number

In this article, we explored how we can find the number of pairs whose sum is divisible by a given number K. This can be done using brute force approach in O(N^2) time but an efficient approach can reduce it to O(N) time.

Sourajeet Mohanty Sourajeet Mohanty
Algorithms

Evolution of Integer Multiplication Algorithms (from 1960 with end in 2019)

We started with an O(N^2) time Integer Multiplication algorithm and it was the first time ever in 1960 that we developed an faster Integer Multiplication algorithm which ran at O(N^1.58) time and now in 2019, we are nearly at the end of this domain with O(N logN) time algorithm.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Research papers on Integer Multiplication (1960 to 2019)

hese are the papers that you should read and understand to understand how we have improved Integer Multiplication over the years and now in 2020, we are on the verge of completing this domain once for all.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Binary exponentiation (Power in log N)

Binary exponentiation is an algorithm to find the power of any number N raise to an number M (N^M) in logarithmic time O(log M). The normal approach takes O(M) time provided multiplication takes constant time.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Check if a number is an Armstrong Number

An Armstrong number is an integer such that the sum of the digits raised to the power of the number of digits is equal to the number itself. We verify it in O(logN * loglogN) time.

Ashutosh Singh Ashutosh Singh
Algorithms

Easiest IMO problems that will make you feel like a Genius

IMO problems are known to be difficult but we have identified 5 problems which you can solve without using a paper. This will make you feel like a GENIUS

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Subset of maximum size with no pair sum divisible by 'K'

Our focus is to find the subset of largest size in which the sum of elements of a pair is not divisible by K. Using mathematical ideas, we solved it in linear time.

Siddharth Agarwal Siddharth Agarwal
Algorithms

Difference between square of sum (Σn)² and sum of squares (Σn²)

In this problem, we to need find the difference between the sum of squares of all numbers from 1 to N and the square of the sum of 1 to N. We solved it in constant time.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Sum of squares of first N numbers ( Σ n² )

Our focus is to find the sum of the quares of the first N numbers that is from 1 to N. With an insightful equation, we can solve this in constant time O(1).

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Sum of first N numbers ( Σ n )

In this problem, we will find the sum of the first N integers that is 1 to N. We can solve this in constant time O(1) by using an insightful formula.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Smallest number with all numbers from 1 to N as multiples

We will find the smallest number that is perfectly divisible by all numbers from 1 to N and used 3 approaches: Brute force O(N^3 * log N), using prime factorization O(N * log N * log N) and using insights into the problem O(N * log log N).

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Largest palindrome made from product of two 3-digit numbers

We will find the largest palindrome that is a product of two three-digit numbers. In brute force, there are 810000 comparisons which we have reduced to 362 computations based on three deep insights.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Largest prime factor of a number (Project Euler Problem 3)

We need to find the largest prime factor of a given number N. We will bring in some insights and solve this in O(√N log log N) time complexity.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Sum of Even Fibonacci Numbers (Project Euler Problem 2)

The problem is find the sum of even fibonacci numbers that is fibonacci numbers that are even and is less than a given number N. We will present 3 insightful ideas to solve this efficiently.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Sum of multiples of 3 and 5 (Project Euler Problem 1)

The problem at hand is to find the sum of all numbers less than a given number N which are divisible by 3 and/ or 5 using a constant time algorithm.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Algorithms

Find point of 2D Line Intersection

The point of intersection of two 2D lines can be calculated using two algorithms namely Elimination method and Determinant method which takes constant time O(1)

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship