[Self-use] Number Theory and Combination Counting Mathematics Related (Theorem & Proof & Board)

0 is written in front

  This article is inspired by NaVi_Awson , and even quoted directly in some places, which is explained here.

1 Number Theory

  1.0 gcd

    1.0.0 gcd

      $gcd(a,b) = gcd(b,a\;mod\;b)$

Proof: Set $c\mid a$, $c\mid b$, then $c\mid (ba)$.

   Let $c\nmid a$, then $c$ is not the common factor of $a,ba$.

   Let $c\mid a$, $c\nmid b$, then $c$ is not the common factor of $a,ba$.

int gcd(int a,int b){
    if(!b) return a;
    return gcd(b,a%b);
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324651929&siteId=291194637