Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 692 Bytes

File metadata and controls

20 lines (13 loc) · 692 Bytes

Math Problem

  • Summation formula of arithmetic sequence: n*(a1+an)/2, n*a1+n(n-1)d/2

Greatest Common Divisor(GCD)

GCD essentially is an intersection between prime factorizations of two numbers. For example, 198 (2 * 3 * 3 * 11) and 84 (2 * 2 * 3 * 7) GCD is 6(2 * 3).

Useful thought

  1. LCM(Least Common Multiple)
  2. GCF(Greatest Common Factor)
  3. In matrix: i/c to find Raw. i%c to find Column
  4. Logarithm: math.log(num, base)
  5. Sieve of Eratosthenes: 952, 204

Math functions

  1. math.comb(n, k): C^k_n combination # Note: reduce(lambda x,y:x*y, range(1, i+1))
  2. math.gcd(x, y): Greatest common divosor of x and y