狂风中文网

Chapter 1 How notto thinkabout numbers(第2页)

天才一秒记住【狂风中文网】地址:https://www.kfzw.net

&otheprimes,thefirsttwentyofthemare:

2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71.

eartheverybeginningofthenumbersequence,primesareohereislittleopportunityforsmallohavefactorizatioheprimesbeerarer.Forexample,thereisoripleofsees:thetrio3,5,7isunique,aseverythirdoddnumberisamultipleof3,andsothiseverhappenagaihinningproeoceis,however,quiteleisurelyandsurprisiiple,thethirtieshaveonlytwoprimes,thosebeing31aimmediatelyafter100therearetwo‘secutive’pairsoftwinprimesin101103and107109.

Theprimeshavebeenasourceoffasforthousandsofyearsbecausethey(aclaimthatweshalljustifyier)yettheyariseamouralnumbersihaphazardfashion.ThismysteriousaablefacetoftheirnatureisexploitediographytosafeguardtialunitheI,whichisthesubjectofChapter4.

gforprimality:primedivisibilitytests

&simple-mindedwayofndingalltheprimesuptoagivennumbersuchas100istowriteallthenumbersdownandcrossoffthebersasyouahodbasedonthisideaiscalledtheSieveofEratosthenesandrunsasfollows.Beginbyg2andthencrossoffallthemultiplesof2(theotherevennumbers)inyourlist.Thehebeginninumberyoumeetthathasnotbeencrossedoff(whichwillbe3)andthencrossoffallitsmultiplesintheremaininglist.Byrepeatingthisprocesssuftlyoften,theprimeswillemergeasthosecrossedout,althoughsomewillbedsomenot.Forexample,Figure1showsthewsofthesieveupto60.

Howdoyouknowwhenyoustopsieviorepeatthisprotilyouumberthatisgreaterthanthesquarerootestnumberinyourlist.Forinstance,ifyoudoyourownsieveforallo120,youwillhthesieveformultiplesof2,3,5,and7,andwhenyoucircle11youstop,as112=121.Atthatpoint,youwillhavecircledasfarastherstprimeexgthesquareroestnumber(120inthiscase)withtheremaiiouched.Allberswillnowhavebeeaseachisamultipleofoneormoreof2,3,5,and7.

1.Primesieve:theprimesupto60arethecrossedout

Itisveryeasytotestfordivisibilityby2andby5astheseprimesaretheprimefaberbasetehis,youoochealdigitofthenumberion:nisdivisibleby2exaitsunitsdigitiseven(i.e.0,2,4,6,or8),andnhas5asafadonlyifitendsin0or5.Nomatterhowmanydigitsthenumbernhas,weoocheckthelastdigittodetermiherleof2orof5.Forprimesthatdoo10,weodoabitmoreworkbutherearesimpletestsfordivisibilitythataremuchquirestodoingthefulldivisionsu

Anumberisdivisibleby3ifandonlyifthesameistrueofthesumofitsdigits.Forexample,thesumofthedigitsofn=145,373,270,099,876,790is87and87=3×29andsonisinthiscasedivisibleby3.Ofcourse,lythetesttotheselfaakingthesumofdigitsoftheouteateachstageuisobvious.Doingthisfivenexampleproducesthefollowingsequence:

145,373,270,099,876,790→87→15→6=2×3.

Youwillseethatallthedivisioedherearesoquickthatyoudlehdozensofdigitswithrelativeeaseeventhoughthesenumbersarebillioerthahwhichyourhandcalculatorcope.

&sgiveheremaio20arebecausetheyareallofthesamegeheseroutinesareallsimpletoapply,althoughitislessobviouswhytheywhthejustifisarenotrecordedhere,theproofsoftheirvalidityarenotespeciallydifficult.

n=27,916,924→2,791,684→279,160→27,916→

2,779→259→7

andsonisdivisibleby7.Eachtimewerunthroughtheloopofinstrus,weloseatleasto,sothenumberofpassesthroughtheloopisaboutthesameasthelengthofthehwhichwebegin.

&herornotnhasafactorof11,subtraaldigitfrtrunumbera.Forexample,thenumberisamultipleof11asourmethodreveals:

4,959,746→495,968→49,588→4,950→495

→44=4×11.

Tocheckfordivisibilityby13,addfourtimesthefinaldigitttrunumberah7and11.Foriheurnsouttohave13asosprimefactors:

11,264,331→1,126,437→112,671→11,271

→1131→117→39=3×13.

For17andfor19,wesubtractfivetimesthefinaldigitinthecaseof17,andaddtwialdigitwheingif19isafaoreapplyingthissteptothetrunumberthatremaiheprocessasoftenasweneed.Forexample,wetest18905fordivisibilityby17:

18,905→1,865→161→11

soitisnotamultipleof17,butfor19,thetestgivestheopposite:

18,905→1,900=100×19

&hisbatteryoftests,youreadilychecktheprimalityofallo500(as232=529exceeds500,so19isthelargestpotentialprimefactorthatyouneedyourselfwith).Forexample,tosettlethematterfor247,wejustocheckfordivisibilityuptotheprime13(asthesquareoftheprime,172=289,exceeds247).Applyifor13,however,welearnfrom247(24+28)=52→13,thatleof13:(247=19×13).

Thedivisibilitytestsforprimesountediofurnishdivisibilitytestsforthosearesquare-freeproductsoftheseprimes(divisiblebythesquareofanyprime)suchas42=2×3×7:anumbernwillbedivisibleby42exarioofdivisibilitytestsfor2,3,asforthosehavesquarefactors,suchas9=32,doically,althoughitisthecasethatnhas9asafadonlyifthatistrueofthesumofthedigitsofn.

Youmightask,afterthousandsofyears,haven’tthoseclevermathematieupwithbetteraicatedmethodsoftestingforprimality?Theanswerisyes.In2002,arelativelyquickwaywasdiscoveredtotestifagivennumberisprime.Theso-called‘AKSprimalitytest’doesnot,however,providethefactorizationofthegivehappee.Theproblemofndingtheprimefactivehoughinprinciplesolvablebytrial,stillseemspractitraelylargeintegers,andforthatreasonitformsthebasisofmuaryeno,asubjecttoillreturninChapter4.Beforethatweshall,iters,lookalittlemorecloselyatprimesandfactorization.

本章未完,请点击下一章继续阅读!若浏览器显示没有新章节了,请尝试点击右上角↗️或右下角↘️的菜单,退出阅读模式即可,谢谢!

如遇章节错误,请点击报错(无需登陆)

新书推荐

情难自控总被隐藏BOSS一见钟情哥斯拉之从金刚骷髅岛开始重生之原配娇妻穿书白月光,病娇反派可狼可奶!霸道帝少惹不得港娱的人生模拟器大美人都是我老婆!上门狂婿从四合院开始的旅行极品婆婆的重生之路穿成咸鱼女配,她靠巅峰系统爆红卖火箭的小女孩[星际]神话三国领主倾世女帝:笑拥江山美男我真不是仙二代修道种田平天下重生异能俏娇妻夫人别嫁了,主帅他不孕不育啊网游之全球问道长生万古:苟在天牢做狱卒峨眉祖师苗疆少年又抢走和亲的九郡主啦从亮剑开始的战争系统权臣火葬场实录