Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Practice Mathematical Algorithm
  • Mathematical Algorithms
  • Pythagorean Triplet
  • Fibonacci Number
  • Euclidean Algorithm
  • LCM of Array
  • GCD of Array
  • Binomial Coefficient
  • Catalan Numbers
  • Sieve of Eratosthenes
  • Euler Totient Function
  • Modular Exponentiation
  • Modular Multiplicative Inverse
  • Stein's Algorithm
  • Juggler Sequence
  • Chinese Remainder Theorem
  • Quiz on Fibonacci Numbers
Open In App
Next Article:
Geometric Algorithms
Next article icon

Mathematical Algorithms

Last Updated : 01 Dec, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The following is the list of mathematical coding problem ordered topic wise. Please refer Mathematical Algorithms (Difficulty Wise) for the difficulty wise list of problems.

GCD and LCM:

  • GCD of Two Numbers
  • LCM of Two Numbers
  • LCM of array
  • GCD of array
  • Basic and Extended Euclidean
  • Stein’s Algorithm for GCD
  • GCD, LCM and Distributive Property
  • Count pairs with gcd (A, B) as B
  • GCD of floating point numbers
  • Series with largest GCD and sum equals to n
  • Largest Subset with GCD 1
  • Summation of GCD of all the pairs up to N

Divisibility & Large Numbers:

  • Divisibility by 3
  • Divisibility by 4
  • Divisibility by 6
  • Divisibility by 7
  • Divisibility by 9
  • Divisibility by 11
  • Divisibility by 12
  • Divisibility by 13
  • Divisibility by 15
  • Divisibility by 29

Series:

  • Juggler Sequence
  • Padovan Sequence
  • Aliquot Sequence
  • Moser-de Bruijn Sequence
  • Stern-Brocot Sequence
  • Newman-Conway Sequence
  • Sylvester’s sequence
  • Recaman’s sequence
  • Sum of 2, 22, 222, ………
  • Sum of 1^2 + 3^2 + 5^2 + . . . + (2*n – 1)^2
  • Sum of 0.6, 0.06, 0.006, 0.0006, …to n terms
  • n-th term of 2, 12, 36, 80, 150….

Number Digits:

  • Minimum digits to remove to make a number Perfect Square
  • Print first k digits of 1/n where n is a positive integer
  • Check if a given number can be represented in given a no. of digits in any base
  • Find element using minimum segments in Seven Segment Display
  • Find next greater number with same set of digits
  • Check if a number is jumbled or not
  • Numbers having difference with digit sum more than s
  • Total numbers with no repeated digits in a range
  • K-th digit in ‘a’ raised to power ‘b’

Algebra:

  • Program to add two polynomials
  • Multiply two polynomials
  • Find number of solutions of a linear equation of n variables
  • Calculate the Discriminant Value
  • Program for dot product and cross product of two vectors
  • Iterated Logarithm log*(n)
  • Program to find correlation coefficient
  • Program for Muller Method
  • Number of non-negative integral solutions of a + b + c = n
  • Generate Pythagorean Triplets

Number System:

  • Exponential notation of a decimal number
  • Check if a number is power of k using base changing method
  • Convert a binary number to hexadecimal number
  • Program for decimal to hexadecimal conversion
  • Converting a Real Number (between 0 and 1) to Binary String
  • Convert from any base to decimal and vice versa
  • Decimal to binary conversion without using arithmetic operators

Prime Numbers & Primality Tests:

  • Prime Numbers
  • Left-Truncatable Prime
  • Mersenne Prime
  • Super Prime
  • Hardy-Ramanujan Theorem
  • Rosser’s Theorem
  • Fermat’s little theorem
  • Introduction to Primality Test and School Method
  • Vantieghems Theorem for Primality Test
  • AKS Primality Test
  • Lucas Primality Test

Prime Factorization & Divisors:

  • Prime factors
  • Smith Numbers
  • Sphenic Number
  • Hoax Number
  • k-th prime factor of a given number
  • Pollard’s Rho Algorithm for Prime Factorization
  • Finding power of prime number p in n!
  • Find all divisors of a natural number
  • Find numbers with n-divisors in a given range

Modular Arithmetic:

  • Modular Exponentiation (Power in Modular Arithmetic)
  • Modular multiplicative inverse
  • Modular Division
  • Euler’s criterion (Check if square root under modulo p exists)
  • Find sum of modulo K of first N natural number
  • How to compute mod of a big number?
  • Exponential Squaring (Fast Modulo Multiplication)
  • Trick for modular division ( (x1 * x2 …. xn) / b ) mod (m)

Factorial:

  • Program for factorial of a number
  • Legendre’s formula (Given p and n, find the largest x such that p^x divides n!)
  • Count trailing zeroes in factorial of a number
  • Factorial of a large number
  • Primorial of a number
  • Find maximum power of a number that divides a factorial
  • Largest power of k in n! (factorial) where k may not be prime
  • Check if a number is a Krishnamurthy Number or not
  • Last non-zero digit of a factorial
  • Count digits in a factorial using Logarithm

Fibonacci Numbers:

  • Fibonacci Numbers
  • Interesting facts about Fibonacci numbers
  • Zeckendorf’s Theorem (Non-Neighbouring Fibonacci Representation)
  • Finding nth Fibonacci Number using Golden Ratio
  • Matrix Exponentiation
  • Fibonacci Coding
  • Cassini’s Identity
  • Tail Recursion for Fibonacci

Catalan Numbers:

  • Catalan numbers
  • Applications of Catalan Numbers
  • Dyck path
  • Succinct Encoding of Binary Tree
  • Find the number of valid parentheses expressions of given length

nCr Computations:

  • Binomial Coefficient
  • Introduction and Dynamic Programming solution to compute nCr%p
  • Program to calculate value of nCr
  • Rencontres Number (Counting partial derangements)
  • Sum of squares of binomial coefficients
  • Space and time efficient Binomial Coefficient
  • Horner’s Method for Polynomial Evaluation

Set Theory:

  • Power Set
  • Minimize the absolute difference of sum of two subsets
  • Sum of all subsets of a set formed by first n natural numbers
  • Sum of average of all subsets
  • Bell Numbers (Number of ways to Partition a Set)

Sieve Algorithms:

  • Sieve of Eratosthenes
  • Segmented Sieve
  • Sieve of Atkin
  • Sieve of Sundaram to print all primes smaller than n
  • Sieve of Eratosthenes in 0(n) time complexity
  • Prime Factorization using Sieve O(log n) for multiple queries

Euler Totient Function:

  • Euler’s Totient Function
  • Optimized Euler Totient Function for Multiple Evaluations
  • Euler’s Totient function for all numbers smaller than or equal to n
  • Primitive root of a prime number n modulo n
  • Euler’s Four Square Identity

Chinese Remainder Theorem:

  • Introduction to Chinese Remainder Theorem
  • Implementation of Chinese Remainder theorem (Inverse Modulo based implementation)
  • Cyclic Redundancy Check and Modulo-2 Division
  • Using Chinese Remainder Theorem to Combine Modular equations

Some Practice Problems:

  • Interquartile Range (IQR)
  • Simulated Annealing
  • Pseudo Random Number Generator (PRNG)
  • Square root of a number using log
  • Find ways an Integer can be expressed as sum of n-th power of unique natural numbers
  • N-th root of a number
  • Fast Fourier Transformation for poynomial multiplication
  • Find Harmonic mean using Arithmetic mean and Geometric mean
  • Double Base Palindrome
  • Program for Derivative of a Polynomial
  • Sgn value of a polynomial
  • Check if a number is a power of another number
  • Program to evaluate simple expressions
  • Make a fair coin from a biased coin
  • Implement *, – and / operations using only + arithmetic operator

Quick Links :

  • Learn Data Structure and Algorithms | DSA Tutorial
  • Practrice Problems on Mathematical Algorithms
  • Quizzes on Mathematical Algorithms
  • Videos on Mathematical Algorithms

Next Article
Geometric Algorithms

H

harendrakumar123
Improve
Article Tags :
  • Mathematical
  • DSA
Practice Tags :
  • Mathematical

Similar Reads

  • Algorithms Tutorial
    Algorithm is a step-by-step procedure for solving a problem or accomplishing a task. In the context of data structures and algorithms, it is a set of well-defined instructions for performing a specific computational task. Algorithms are fundamental to computer science and play a very important role
    1 min read
  • What is an Algorithm | Introduction to Algorithms
    The word Algorithm means "A set of finite rules or instructions to be followed in calculations or other problem-solving operations" Or "A procedure for solving a mathematical problem in a finite number of steps that frequently involves recursive operations". Therefore Algorithm refers to a sequence
    15+ min read
  • Definition, Types, Complexity and Examples of Algorithm
    An algorithm is a well-defined sequential computational technique that accepts a value or a collection of values as input and produces the output(s) needed to solve a problem. Or we can say that an algorithm is said to be accurate if and only if it stops with the proper output for each input instanc
    13 min read
  • Algorithms Design Techniques
    What is an algorithm? An Algorithm is a procedure to solve a particular problem in a finite number of steps for a finite-sized input. The algorithms can be classified in various ways. They are: Implementation MethodDesign MethodDesign ApproachesOther ClassificationsIn this article, the different alg
    10 min read
  • Why is Analysis of Algorithm important?
    Why is Performance of Algorithms Important ? There are many important things that should be taken care of, like user-friendliness, modularity, security, maintainability, etc. Why worry about performance? The answer to this is simple, we can have all the above things only if we have performance. So p
    2 min read
  • Analysis of Algorithms

    • Asymptotic Analysis
      Given two algorithms for a task, how do we find out which one is better? One naive way of doing this is - to implement both the algorithms and run the two programs on your computer for different inputs and see which one takes less time. There are many problems with this approach for the analysis of
      3 min read

    • Worst, Average and Best Case Analysis of Algorithms
      In the previous post, we discussed how Asymptotic analysis overcomes the problems of the naive way of analyzing algorithms. Now let us learn about What is Worst, Average, and Best cases of an algorithm: 1. Worst Case Analysis (Mostly used) In the worst-case analysis, we calculate the upper bound on
      10 min read

    • Types of Asymptotic Notations in Complexity Analysis of Algorithms
      We have discussed Asymptotic Analysis, and Worst, Average, and Best Cases of Algorithms. The main idea of asymptotic analysis is to have a measure of the efficiency of algorithms that don't depend on machine-specific constants and don't require algorithms to be implemented and time taken by programs
      8 min read

    • How to Analyse Loops for Complexity Analysis of Algorithms
      We have discussed Asymptotic Analysis, Worst, Average and Best Cases and Asymptotic Notations in previous posts. In this post, an analysis of iterative programs with simple examples is discussed. The analysis of loops for the complexity analysis of algorithms involves finding the number of operation
      15+ min read

    • How to analyse Complexity of Recurrence Relation
      The analysis of the complexity of a recurrence relation involves finding the asymptotic upper bound on the running time of a recursive algorithm. This is usually done by finding a closed-form expression for the number of operations performed by the algorithm as a function of the input size, and then
      7 min read

    • Introduction to Amortized Analysis
      Amortized Analysis is used for algorithms where an occasional operation is very slow, but most other operations are faster. In Amortized Analysis, we analyze a sequence of operations and guarantee a worst-case average time that is lower than the worst-case time of a particularly expensive operation.
      10 min read

    Types of Algorithms

    • Sorting Algorithms
      A Sorting Algorithm is used to rearrange a given array or list of elements in an order. For example, a given array [10, 20, 5, 2] becomes [2, 5, 10, 20] after sorting in increasing order and becomes [20, 10, 5, 2] after sorting in decreasing order. There exist different sorting algorithms for differ
      3 min read

    • Searching Algorithms
      Searching algorithms are essential tools in computer science used to locate specific items within a collection of data. In this tutorial, we are mainly going to focus upon searching in an array. When we search an item in an array, there are two most common algorithms used based on the type of input
      3 min read

    • Greedy Algorithms
      Greedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum solution. At every step of the algorithm, we make a choice that looks the best at the moment. To make the choice, we sometimes sort the array so that we can always get
      3 min read

    • Dynamic Programming or DP
      Dynamic Programming is an algorithmic technique with the following properties. It is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for the same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of
      3 min read

    • What is Pattern Searching ?
      Pattern searching in Data Structures and Algorithms (DSA) is a fundamental concept that involves searching for a specific pattern or sequence of elements within a given data structure. This technique is commonly used in string matching algorithms to find occurrences of a particular pattern within a
      5 min read

    • Backtracking Algorithm
      Backtracking algorithms are like problem-solving strategies that help explore different options to find the best solution. They work by trying out different paths and if one doesn't work, they backtrack and try another until they find the right one. It's like solving a puzzle by testing different pi
      4 min read

    • Divide and Conquer Algorithm
      Divide and Conquer algorithm is a problem-solving strategy that involves. Divide : Break the given problem into smaller non-overlapping problems.Conquer : Solve Smaller ProblemsCombine : Use the Solutions of Smaller Problems to find the overall result.Examples of Divide and Conquer are Merge Sort, Q
      1 min read

    • Mathematical Algorithms
      The following is the list of mathematical coding problem ordered topic wise. Please refer Mathematical Algorithms (Difficulty Wise) for the difficulty wise list of problems. GCD and LCM: GCD of Two Numbers LCM of Two Numbers LCM of array GCD of array Basic and Extended Euclidean Stein’s Algorithm fo
      5 min read

    • Geometric Algorithms
      Geometric algorithms are a type of algorithm that deal with solving problems related to geometry. These algorithms are used to solve various geometric problems such as computing the area of a polygon, finding the intersection of geometric shapes, determining the convex hull of a set of points, and m
      4 min read

    • Bitwise Algorithms
      Bitwise algorithms in Data Structures and Algorithms (DSA) involve manipulating individual bits of binary representations of numbers to perform operations efficiently. These algorithms utilize bitwise operators like AND, OR, XOR, NOT, Left Shift, and Right Shift. BasicsIntroduction to Bitwise Algori
      4 min read

    • Graph Algorithms
      Graph algorithms are methods used to manipulate and analyze graphs, solving various range of problems like finding the shortest path, cycles detection. If you are looking for difficulty-wise list of problems, please refer to Graph Data Structure. BasicsGraph and its representationsBFS and DFS Breadt
      3 min read

    • Randomized Algorithms
      Randomized algorithms in data structures and algorithms (DSA) are algorithms that use randomness in their computations to achieve a desired outcome. These algorithms introduce randomness to improve efficiency or simplify the algorithm design. By incorporating random choices into their processes, ran
      2 min read

    • Branch and Bound Algorithm
      The Branch and Bound Algorithm is a method used in combinatorial optimization problems to systematically search for the best solution. It works by dividing the problem into smaller subproblems, or branches, and then eliminating certain branches based on bounds on the optimal solution. This process c
      1 min read

  • The Role of Algorithms in Computing
    Algorithms play a crucial role in computing by providing a set of instructions for a computer to perform a specific task. They are used to solve problems and carry out tasks in computer systems, such as sorting data, searching for information, image processing, and much more. An algorithm defines th
    8 min read
  • Most important type of Algorithms
    What is an Algorithm?An algorithm is a step-by-step procedure to solve a problem. A good algorithm should be optimized in terms of time and space. Different types of problems require different types of algorithmic techniques to be solved in the most optimized manner. There are many types of algorith
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences