# Mathematical Algorithms

**‘Recent Articles’ on Mathematical Algorithms**

**Topic :**

- GCD and LCM
- LCM of array
- GCD of array
- Basic and Extended Euclidean algorithms
- GCD of two numbers when one of them can be very large
- Stein’s Algorithm for finding GCD
- GCD, LCM and Distributive Property
- Replace every matrix element with maximum of GCD of row or column
- GCD of two numbers formed by n repeating x and y times
- Count number of pairs (A <= N, B <= N) such that gcd (A , B) is B

Recent Articles on GCD and LCM!

**Prime Factorization and Divisors :**

- Prime factors
- Pollard’s Rho Algorithm for Prime Factorization
- Find all divisors of a natural number
- Sum of all proper divisors of a natural number
- Prime Factorization using Sieve O(log n) for multiple queries
- Find politeness of a number
- Print prime numbers in a given range using C++ STL
- k-th prime factor of a given number
- Smith Numbers
- Sphenic Number

Recent Articles on Prime Factors!

- Fibonacci Numbers
- Interesting facts about Fibonacci numbers
- How to check if a given number is Fibonacci number?
- Zeckendorf’s Theorem (Non-Neighbouring Fibonacci Representation)
- Finding nth Fibonacci Number using Golden Ratio
- Matrix Exponentiation
- Fibonacci Coding
- n’th multiple of a number in Fibonacci Series
- GCD and Fibonacci Numbers
- Cassini’s Identity

Recent Articles on Fibonacci Numbers!

Recent Articles on Catalan Numbers!

- Modular Exponentiation (Power in Modular Arithmetic)
- Modular multiplicative inverse
- Modular Division
- Multiplicative order
- Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)
- Find Square Root under Modulo p | Set 2 (Shanks Tonelli algorithm)
- Euler’s criterion (Check if square root under modulo p exists)
- Multiply large integers under large modulo
- Find sum of modulo K of first N natural number
- How to compute mod of a big number?
- BigInteger Class in Java
- Modulo 10^9+7 (1000000007)
- How to avoid overflow in modular multiplication?
- RSA Algorithm in Cryptography
- Find (a^b)%m where ‘a’ is very large
- Find power of power under mod of a prime

Recent Articles on Modular Arithmetic!

- Factorial
- Legendre’s formula (Given p and n, find the largest x such that p^x divides n!)
- Sum of divisors of factorial of a number
- Count Divisors of Factorial
- Compute n! under modulo p
- Double factorial
- Count trailing zeroes in factorial of a number
- Factorial of a large number
- Primorial of a number
- Find the first natural number whose factorial is divisible by x

**Prime numbers and Primality Tests :**

- Wilson’s Theorem
- Primality Test | Set 1 (Introduction and School Method)
- Primality Test | Set 2 (Fermat Method)
- Primality Test | Set 3 (Miller–Rabin)
- Primality Test | Set 4 (Solovay-Strassen)
- GFact 22 | (2^x + 1 and Prime)
- Euclid’s Lemma
- Left-Truncatable Prime
- Mersenne Prime
- Super Prime
- Circular primes less than n
- Palindromic Primes
- Almost Prime Numbers
- Find the prime numbers which can written as sum of most consecutive primes

Recent Articles on Prime Number!

**Divisibility and Large Numbers :**

- Check if a large number is divisible by 3 or not
- Check if a large number is divisible by 11 or not
- To check divisibility of any large number by 999
- Smallest number divisible by first n numbers
- Find Last Digit Of a^b for Large Numbers
- Number of substrings divisible by 6 in a string of integers
- Remainder with 7 for large numbers
- Divide large number represented as string
- Multiply Large Numbers represented as Strings
- Difference of two large numbers

Recent Articles on Divisibility!

Recent Articles on Large Numbers!

- n-th number with digits in {0, 1, 2, 3, 4, 5}
- Find next greater number with same set of digits
- Print first k digits of 1/n where n is a positive integer
- Build Lowest Number by Removing n digits from a given number
- Program to check if a given number is Lucky
- Check if a given number can be represented in given a no. of digits in any base
- Count digits in given number N which divide N
- Count digit groupings of a number with given constraints
- K’th Boom Number
- Seeds (Or Seed Roots) of a number
- Find element using minimum segments in Seven Segment Display
- Automorphic Number
- Form the largest number using at most one swap operation

Recent Articles on Number Digits!