‘Recent Articles’ on Mathematical Algorithms
Topic :

GCD and LCM :

  1. GCD and LCM
  2. LCM of array
  3. GCD of array
  4. Basic and Extended Euclidean algorithms
  5. GCD of two numbers when one of them can be very large
  6. Stein’s Algorithm for finding GCD
  7. GCD, LCM and Distributive Property
  8. Replace every matrix element with maximum of GCD of row or column
  9. GCD of two numbers formed by n repeating x and y times
  10. 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 :

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

Recent Articles on Prime Factors!

Fibonacci Numbers :

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

Recent Articles on Fibonacci Numbers!

Catalan Numbers :

  1. Catalan numbers
  2. Applications of Catalan Numbers
  3. Program for nth Catalan Number
  4. Dyck path
  5. Non-crossing lines to connect points in a circle
  6. Succinct Encoding of Binary Tree

Recent Articles on Catalan Numbers!

Modular Arithmetic :

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

Recent Articles on Modular Arithmetic!

Euler Totient Function :

  1. Euler’s Totient Function
  2. Optimized Euler Totient Function for Multiple Evaluations
  3. Euler’s Totient function for all numbers smaller than or equal to n
  4. Primitive root of a prime number n modulo n

nCr Computations :

  1. Binomial Coefficient
  2. Compute nCr % p | Set 1 (Introduction and Dynamic Programming Solution)
  3. Compute nCr % p | Set 2 (Lucas Theorem)
  4. Compute nCr % p | Set 3 (Using Fermat Little Theorem)

Chinese Remainder Theorem :

  1. Set 1 (Introduction)
  2. Set 2 (Inverse Modulo based Implementation)
  3. Cyclic Redundancy Check and Modulo-2 Division
  4. Using Chinese Remainder Theorem to Combine Modular equations

Factorial :

  1. Factorial
  2. Legendre’s formula (Given p and n, find the largest x such that p^x divides n!)
  3. Sum of divisors of factorial of a number
  4. Count Divisors of Factorial
  5. Compute n! under modulo p
  6. Double factorial
  7. Count trailing zeroes in factorial of a number
  8. Factorial of a large number
  9. Primorial of a number
  10. Find the first natural number whose factorial is divisible by x

Recent Articles on Factorial!

Prime numbers and Primality Tests :

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

Recent Articles on Prime Number!

Sieve Algorithms :

  1. Sieve of Eratosthenes
  2. Segmented Sieve
  3. Sieve of Atkin
  4. Sieve of Sundaram to print all primes smaller than n
  5. Sieve of Eratosthenes in 0(n) time complexity

Recent Articles on Sieve!

Divisibility and Large Numbers :

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

Recent Articles on Divisibility!
Recent Articles on Large Numbers!

Series :

  1. Juggler Sequence
  2. Padovan Sequence
  3. Abundant Number
  4. Hexagonal Number
  5. Emirp numbers
  6. Aliquot Sequence
  7. Removing a number from array to make it Geometric Progression
  8. Carol Number
  9. Kaprekar Number
  10. Keith Number
  11. N’th Smart Number
  12. Disarium Number
  13. Carmichael Numbers

Recent Articles on Series!

Number Digits :

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

Recent Articles on Number Digits!

Company Wise Coding Practice    Topic Wise Coding Practice