Essential mathematical algorithms and efficiency logic.
Determines if a number is prime by checking divisors only up to ān (O(ān)).
Loading...
Calculates the product of all positive integers up to n (O(n)).
Loading...
Finds the largest shared factor using the Euclidean Algorithm (O(log min(a,b))).
Loading...
Smallest number divisible by both inputs. Built on GCD: LCM(a,b) = |aĆb| / GCD(a,b).
Loading...
Generates the nth Fibonacci number iteratively in O(n) time and O(1) space.
Loading...
Raises a base to an exponent. Fast exponentiation (O(log n)) handles large exponents efficiently.
Loading...