⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chap4.tex

📁 Concrete_Mathematics_2nd_Ed_TeX_Source_Code
💻 TEX
📖 第 1 页 / 共 5 页
字号:
% Chapter 4 of Concrete Mathematics% (c) Addison-Wesley, all rights reserved.\input gkpmac\refin bib\refin chap2\refin chap3\pageno=102\beginchapter 4 Number TheoryINTEGERS ARE CENTRAL to the discrete mathematics we are emphasizing inthis book. Therefore we want to explore the {\it"theory" of "numbers"},an important branch of mathematics concerned with the properties ofintegers.We tested the number theory waters in the previous chapter, by introducing\g In other words, be prepared to drown.\gbinary operations called `mod' and `gcd'. Now let's plunge in andreally immerse ourselves in the subject.\beginsection 4.1 DivisibilityWe say that $m$ divides $n$ (or $n$ is "divisible" by $m$) if $m>0$and the ratio $n/m$ is an integer. This property underlies all ofnumber theory, so it's convenient to have a special "notation" for it.We therefore write\tabref|nn:div|%\begindisplaym\divides n\quad\iff\quad m>0\!\!\And\!\!\hbox{$n=mk$ for some integer $k$}\,.\eqno\eqref|div-def|\enddisplay(The notation `$m@\vert@n$' is actually much more common than `$m\divides n$'in current mathematics literature. But vertical lines are overused\dash---%for absolute values, set delimiters, conditional probabilities, etc.\dash---%and backward slashes are under\-used. Moreover, `$m\divides n$' gives animpression that $m$ is the denominator of an implied ratio. So we shallboldly let our divisibility symbol lean leftward.)If $m$ does not divide $n$ we write `$m\ndivides n$'.There's a similar relation, ``$n$ is a "multiple" of~$m$,\qback'' whichmeans almost the same thing except that $m$~doesn't have to be positive.In this case we simply mean that $n=mk$ for some integer~$k$. Thus, for\g\noindent\llap{``}\dots\ no integer is divisible by~$-1$ (strictly speaking).''\par\hfill\dash---"Graham", "Knuth",\par\hfill and "Patashnik" [|conc-math|]\gexample, there's only one multiple of~$0$ (namely~$0$), but nothing isdivisible by~$0$.Every integer is a multiple of~$-1$, but no integer is divisibleby~$-1$ (strictly speaking). These definitions apply when $m$ and~$n$ are any realnumbers; for example, $2\pi$ is divisible by~$\pi$.But we'll almost always be using them when $m$ and~$n$ areintegers. After all, this is number theory.The {\it "greatest common divisor"\/} of two integers $m$ and~$n$ is the\g In Britain we call this `hcf' ("highest common factor").\glargest integer that divides them both:\begindisplay\gcd(m,n)=\max\,\{\,k\mid k\divides m\And k\divides n\,\}\,.\eqno\eqref|gcd-def|\enddisplayFor example, $\gcd(12,18)=6$. This is a familiar notion, because it's thecommon factor that fourth graders learn to take out of a fraction"!gcd"$m/n$ when reducing it to lowest terms: $12/18=(12/6)\big/(18/6)=2/3$.Notice that if $n>0$ we have $\gcd(0,n)=n$, because any positivenumber divides~$0$, and because$n$~is the largest divisor of itself. The value of $\gcd(0,0)$ isundefined.Another familiar notion is the {\it "least common multiple"},\g Not to be confused with the greatest common multiple.\g"!lcm"\begindisplay\lcm(m,n)=\min\,\{\,k\mid\hbox{$k>0$},\quad m\divides k\And n\divides k\,\}\,;\eqno\eqref|lcm-def|\enddisplaythis is undefined if $m\le0$ or $n\le0$. Students of arithmetic recognizethis as the least common denominator, which is used when adding fractionswith denominators $m$ and~$n$. For example, $\lcm(12,18)=36$, andfourth graders know that${7\over12}+{1\over18}={21\over36}+{2\over36}={23\over36}$.The lcm is somewhat analogous to the gcd, but we don't give it equal timebecause the gcd has nicer properties.One of the nicest properties of the gcd is that it is easy to compute,using a 2300-year-old method called {\it "Euclid's algorithm"}."!algorithm, Euclid's"To calculate $\gcd(m,n)$, for given values$0\le m<n$, Euclid's algorithm uses the recurrence\begindisplay\gcd(0,n)&=n\,;\cr\gcd(m,n)&=\gcd(n\bmod m,\,m)\,,\qquad\hbox{for $m>0$}.\eqno\eqref|euclid|\enddisplayThus, for example, $\gcd(12,18)=\gcd(6,12)=\gcd(0,6)=6$. The stated recurrenceis valid, because any common divisor of $m$ and~$n$ must also be a commondivisor of both $m$ and the number $n\bmod m$,which is $n-\lfloor n/m\rfloor m$. There doesn't seemto be any recurrence for $\lcm(m,n)$ that's anywhere near as simple asthis. (See exercise~|gcd-times-lcm|.)Euclid's algorithm also gives us more: We can extend it so that it will computeintegers $m'$ and~$n'$ satisfying\begindisplaym'm+n'n=\gcd(m,n)\,.\eqno\eqref|''|\enddisplay\g(Remember that $m'$ or $n'$ can be negative.)\gHere's how. If $m=0$, we simply take $m'=0$ and $n'=1$. Otherwise we let$r=n\bmod m$ and apply the method recursively with $r$~and~$m$ in placeof $m$~and~$n$, computing $\overline r$ and $\overline m$ such that\begindisplay\overline r\,r+\overline m\,m=\gcd(r,m)\,.\enddisplaySince $r=n-\lfloor n/m\rfloor m$ and $\gcd(r,m)=\gcd(m,n)$,this equation tells us that\begindisplay\overline r\,\bigl(n-\lfloor n/m\rfloor m\bigr)+\overline m\,m=\gcd(m,n)\,.\enddisplayThe left side can be rewritten to show its dependency on $m$ and $n$:\begindisplay\bigl(\overline m-\lfloor n/m\rfloor@\overline r@\bigr)\,m+\overline r\, n=\gcd(m,n)\,;\enddisplayhence $m'=\overline m-\lfloor n/m\rfloor\overline r$ and $n'=\overline r$ are the integers we need in \thiseq. For example, in ourfavorite case $m=12$, $n=18$, this method gives $6=0\cdt0+1\cdt6=1\cdt6+0\cdt12=(-1)\cdt12+1\cdt18$.But why is \thiseq\ such a neat result? The main reason is that there's asense in which the numbers $m'$ and~$n'$actually {\it prove\/} that Euclid's algorithm has produced the correctanswer in any particular case. Let's suppose that our computerhas told us after a lengthy calculation that $\gcd(m,n)=d$ and that$m'm+n'n=d$; but we're skeptical and think that there's really a greatercommon divisor, which the machine has somehow overlooked. This cannot be,however,because any common divisor of $m$ and~$n$ has to divide $m'm+n'n$;so it has to divide~$d$; so it has to be $\le d$. Furthermore we caneasily check that $d$ does divide both $m$ and $n$. (Algorithms that"!certificate of correctness"output their own proofs of correctness are called {\it "self-certifying"}.)We'll be using \thiseq\ a lot in the rest of this chapter. One of itsimportant consequences is the following mini-theorem:\begindisplayk\divides m\And k\divides n\qquad\iff\qquad k\divides\gcd(m,n)\,.\eqno\eqref|div-gcd|\enddisplay(Proof: If $k$ divides both $m$ and~$n$, it divides $m'm+n'n$,so it divides $\gcd(m,n)$. Conversely, if $k$ divides $\gcd(m,n)$, itdivides a divisor of~$m$ and a divisor of~$n$, so it divides both$m$ and~$n$.) We always knew that any common divisor of $m$ and~$n$ must be{\it less than or equal to\/} their gcd; that's the definition of greatestcommon divisor. But now we know that any common divisor is, in fact,{\it a divisor of\/} their gcd.Sometimes we need to do sums over all divisors of~$n$. In this caseit's often useful to use the handy rule\begindisplay\sum_{m\divides n}a_m=\sum_{m\divides n}a_{n/m}\,,\qquad \hbox{integer $n>0$,}\eqno\eqref|swap-div|\enddisplaywhich holds since $n/m$ runs through all divisors of~$n$ when $m$ does.For example, when $n=12$ this says that $a_1+a_2+a_3+a_4+a_6+a_{12}=a_{12}+a_6+a_4+a_3+a_2+a_1$.There's also a slightly more general identity,\begindisplay\sum_{m\divides n}a_m=\sum_k\sum_{m>0}a_m\[n=mk]\,,\eqno\eqref|sum-div|\enddisplaywhich is an immediate consequence of the definition \eq(|div-def|).If $n$ is positive, the right-hand side of~\thiseq\ is $\sum_{k\divides n}a_{n/k}$; hence \thiseq\ implies \eq(|swap-div|).And equation \thiseq\ works also when $n$ is negative. (In such cases,the nonzero terms on the right occur when $k$ is the negative ofa divisor of~$n$.)Moreover, a "double sum" over divisors can be ``interchanged'' by the law\begindisplay\sum_{m\divides n}\,\sum_{k\divides m}a_{k,m}=\sum_{k\divides n}\,\sum_{l\divides(n/k)}a_{k,kl}\,.\eqno\eqref|interch-div|\enddisplayFor example, this law takes the following form when $n=12$:\begindisplay \def\\#1#2{a_{#1,#2}} \def\@{{12}}&\\11\,+\,(\\12+\\22)\,+\,(\\13+\\33)\cr&\qquad\qquad+\,(\\14+\\24+\\44)\,+\,(\\16+\\26+\\36+\\66)\cr&\qquad\qquad+\,(\\1\@+\\2\@+\\3\@+\\4\@+\\6\@+\\\@\@)\cr\noalign{\vskip2pt}&\quad=(\\11+\\12+\\13+\\14+\\16+\\1\@)\cr&\qquad\qquad+\,(\\22+\\24+\\26+\\2\@)\,+\,(\\33+\\36+\\3\@)\cr&\qquad\qquad+\,(\\44+\\4\@)\,+\,(\\66+\\6\@)\,+\,\\\@\@\,.\cr\enddisplayWe can prove \thiseq\ with Iversonian manipulation. The left-hand side is\begindisplay\sum_{j,l}\,\sum_{k,m>0}a_{k,m}\[n=jm]\[m=kl]=\sum_j\sum_{k,l>0}a_{k,kl}\[n=jkl]\,;\enddisplaythe right-hand side is\begindisplay\sum_{j,m}\,\sum_{k,l>0}a_{k,kl}\[n=jk]\[n/k=ml]=\sum_m\sum_{k,l>0}a_{k,kl}\[n=mlk]\,,\enddisplaywhich is the same except for renaming the indices.This example indicates that the techniques we've learned in Chapter~2 willcome in handy as we study number theory.\beginsection 4.2 PrimesA positive integer~$p$ is called {\it "prime"\/} if it has just twodivisors, namely$1$~and~$p$. {\sl Throughout the rest of this chapter, the letter~$p$will always stand for a prime number, even when we don't say so explicitly.}\g How about the p in `explicitly'?\gBy convention, $1$~isn't prime, so the sequence of primes starts out like this:\begindisplay 2,\,3,\,5,\,7,\,11,\,13,\,17,\,19,\,23,\,29,\,31,\,37,\,41,\, \ldots \,.\enddisplay"!Seaver, George Thomas"Some numbers look prime but aren't, like $91$ ($=7\cdt13$) and$161$ ($=7\cdt23$). These numbers and others that have three or more divisorsare called {\it "composite"}. Every integer greater than~$1$ is either primeor composite, but not both.Primes are of great importance, because they're the fundamental building blocksof all the positive integers. Any positive integer~$n$ can be written as aproduct of primes,\begindisplay\advance\abovedisplayskip-5pt \advance\belowdisplayskip-2ptn=p_1\ldots p_m=\prod_{k=1}^m p_k\,,\qquad p_1\le\cdots\le p_m\,.\eqno\eqref|prime-factors|\enddisplay For example,$12=2\cdt2\cdt3$; $11011=7\cdt11\cdt11\cdt13$; $11111=41\cdt271$."!Seaver, George Thomas"(Products denoted by $\prod$ are analogous to sums denoted by $\sum$, as"!product $\prod$"explained in exercise~2.|prod-analogies|.If $m=0$, we consider this to be an "empty product", whose value is~$1$by definition; that's the way $n=1$ gets represented by \thiseq.) Sucha factorization is always possible because if $n>1$ is not prime it hasa divisor $n_1$ such that $1<n_1<n$; thus we can write $n=n_1\cdt n_2$,and (by induction) we know that $n_1$ and $n_2$ can be written asproducts of primes.Moreover, the expansion in \thiseq\ is {\it unique\/}: There's only one"!unique factorization" "!factorization into primes"way to write $n$ as a product of primes in nondecreasing order. Thisstatement iscalled the "Fundamental Theorem of Arithmetic", and it seems so obviousthat we might wonder why it needs to be proved. How could there be twodifferent sets of primes with the same product? Well, there can't, butthe reason {\it isn't\/} simply ``by definition of prime numbers.\qback''For example, if we consider the set of all real numbers of theform $m+n\sqrt{10}$ when $m$ and $n$ are integers, the product of anytwo such numbers is again of the same form, and we can call sucha number ``prime'' if itcan't be factored in a nontrivial way. The number $6$ has two representations,$2\cdt3=(4+\sqrt{10}\,)(4-\sqrt{10}\,)$;yet exercise~|nonunique-factors| shows that$2$, $3$, $4+\sqrt{10}$, and $4-\sqrt{10}$ are all ``prime''in this system.Therefore we should prove rigorously that \thiseq\ is unique. There is certainlyonly one possibility when $n=1$, since the product must be empty in that case;so let's suppose that $n>1$ and that all smallernumbers factor uniquely. Suppose we have two factorizations\begindisplayn=p_1\ldots p_m=q_1\ldots q_k\,,\qquad p_1{\le}\cdots{\le} p_m\Andq_1{\le}\cdots{\le} q_k\,,\enddisplaywhere the $p$'s and $q$'s are all prime.We will prove that $p_1=q_1$.If not, we can assume that $p_1<q_1$, making$p_1$ smaller than all the $q$'s. Since $p_1$ and $q_1$ are prime,their gcd must be~$1$; hence Euclid's self-certifying algorithmgives us integers $a$ and $b$ such that $ap_1+bq_1=1$. Therefore\begindisplayap_1q_2\ldots q_k\,+\,bq_1q_2\ldots q_k=q_2\ldots q_k\,.\enddisplayNow $p_1$ divides both terms on the left, since $q_1q_2\ldots q_k=n$;hence $p_1$ divides the right-hand side, $q_2\ldots q_k$.Thus $q_2\ldots q_k/p_1$ is an integer, and $q_2\ldots q_k$ has a primefactorization in which $p_1$ appears. But $q_2\ldots q_k<n$, so it has aunique factorization (by induction).This contradiction shows that $p_1$ must be equal to~$q_1$ after all.Therefore we can divide both of $n$'s factorizations by $p_1$, obtaining$p_2\ldots p_m=q_2\ldots q_k<n$. The other factors must likewise be equal(by induction), so our proof of uniqueness is complete.Sometimes it's more useful to state the Fundamental Theorem in\g It's the factorization, not the theorem, that's unique.\ganother way: {\sl Every positive integer can be written uniquely in the form}\begindisplay \advance\belowdisplayskip-3ptn\;=\;\prod_p p^{n_p}\,,\qquad\hbox{where each $n_p\ge0$}.\eqno\eqref|primepower-factors|\enddisplayThe right-hand side is a product over

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -