math Directory Reference

## Files

file | armstrong_number.cpp
| Program to check if a number is an Armstrong/Narcissistic number in decimal system.
file | binary_exponent.cpp
| C++ Program to find Binary Exponent Iteratively and Recursively.
file | check_amicable_pair.cpp
| A C++ Program to check whether a pair of number is amicable pair or not.
file | check_factorial.cpp
| A simple program to check if the given number is a factorial of some number or not.
file | check_prime.cpp
| Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime.
file | complex_numbers.cpp
| An implementation of Complex Number as Objects.
file | double_factorial.cpp
| Compute double factorial: \(n!!\).
file | eulers_totient_function.cpp
| C++ Program to find Euler's Totient function.
file | extended_euclid_algorithm.cpp
| GCD using extended Euclid's algorithm
file | factorial.cpp
| C++ program to find factorial of given number.
file | fast_power.cpp
| Faster computation for \(a^b\).
file | fibonacci.cpp
| Generate fibonacci sequence.
file | fibonacci_fast.cpp
| Faster computation of Fibonacci series.
file | fibonacci_large.cpp
| Computes N^th Fibonacci number given as input argument. Uses custom build arbitrary integers library to perform additions and other operations.
file | fibonacci_matrix_exponentiation.cpp
| This program computes the N^th Fibonacci number in modulo mod input argument .
file | fibonacci_sum.cpp
| An algorithm to calculate the sum of Fibonacci Sequence: \(\mathrm{F}(n) + \mathrm{F}(n+1) + .. + \mathrm{F}(m)\).
file | gcd_iterative_euclidean.cpp
| Compute the greatest common denominator of two integers using iterative form of Euclidean algorithm
file | gcd_of_n_numbers.cpp
| This program aims at calculating the GCD of n numbers by division method.
file | gcd_recursive_euclidean.cpp
| Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm
file | large_factorial.cpp
| Compute factorial of any arbitratily large number/.
file | large_number.h [code]
| Library to perform arithmatic operations on arbitrarily large numbers.
file | largest_power.cpp
| Algorithm to find largest x such that p^x divides n! (factorial) using Legendre's Formula.
file | lcm_sum.cpp
| An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\).
file | least_common_multiple.cpp
file | magic_number.cpp
| A simple program to check if the given number is a magic number or not. A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number.
file | miller_rabin.cpp
file | modular_division.cpp
| An algorithm to divide two numbers under modulo p Modular Division
file | modular_exponentiation.cpp
| C++ Program for Modular Exponentiation Iteratively.
file | modular_inverse_fermat_little_theorem.cpp
| C++ Program to find the modular inverse using Fermat's Little Theorem
file | n_choose_r.cpp
| Combinations n choose r function implementation
file | ncr_modulo_p.cpp
| This program aims at calculating nCr modulo p.
file | number_of_positive_divisors.cpp
| C++ Program to calculate the number of positive divisors.
file | power_for_huge_numbers.cpp
| Compute powers of large numbers.
file | prime_factorization.cpp
| Prime factorization of positive integers.
file | prime_numbers.cpp
| Get list of prime numbers.
file | primes_up_to_billion.cpp
| Compute prime numbers upto 1 billion.
file | realtime_stats.cpp
| Compute statistics for data entered in rreal-time.
file | sieve_of_eratosthenes.cpp
| Get list of prime numbers using Sieve of Eratosthenes.
file | sqrt_double.cpp
| Calculate the square root of any positive real number in \(O(\log N)\) time, with precision fixed using bisection method of root-finding.
file | string_fibonacci.cpp
| This Programme returns the Nth fibonacci as a string.
file | sum_of_binomial_coefficient.cpp
| Algorithm to find sum of binomial coefficients of a given positive integer.
file | sum_of_digits.cpp
| A C++ Program to find the Sum of Digits of input integer.
file | vector_cross_product.cpp
| Calculates the Cross Product and the magnitude of two mathematical 3D vectors.