Algorithams-php

  1. mathlib class - To get result of various mathamatic operations

    a) sum($n) - return sum of first n positive numbers. b) sumEven($n) - return sum of first n positive even numbers. c) sumOdd($n) - return sum of first n positive odd numbers. d) primes($n) - return the prime numbers upto n. e) isPrime($n) - return true or false based on the give number. g) fact($n) - return the factorial of n. h) fibonacciNumbers($n) - return fibnocci numbers upto n. i) lcm($numbers) - return the LCM of given numbers(array). j) gcd($numbers) - return the GCD of given numbers(array).