把4楼的程序改成并行,输出首项与项数
- Range[1,100000000,10]//ParallelCombine[Select[#,PrimeQ]&,#]&//Partition[#,2,1]&//{{6,#[[1,1]]-5}}~Join~Parallelize[{#[[1]]+5,#[[2]]-5}&/@#]~Join~{{#[[-1,-1]]+5,99999996}}&//Parallelize[{#[[1]],(#[[2]]-#[[1]])/5+1}&/@#]&//Select[#,#[[2]]>=100&]&
复制代码{{7929496,107},{9775776,101},{11066926,113},{11300416,105},{11842006,111},{13167256,117},{13817566,101},{13943356,123},{15719026,101},{17904366,101},{18719796,127},{18980566,111},{19981366,105},{20494656,103},{21235116,103},{21850186,107},{22964106,101},{26318016,101},{26512536,101},{26972686,113},{27334306,107},{27449716,107},{27465966,107},{28189246,101},{30363636,103},{31278706,105},{31419816,113},{31857156,133},{34496616,115},{34610676,133},{35267866,105},{35803426,101},{36571266,115},{36657966,119},{39493066,113},{39569806,111},{40106586,119},{41242506,101},{41300106,107},{41352306,115},{41398006,105},{41614726,105},{41766426,107},{42402556,113},{43011196,101},{43421356,105},{45064366,105},{45309526,105},{45784776,101},{46895496,109},{47065536,103},{47465656,117},{48145896,103},{48783066,109},{49443456,103},{49641966,113},{50357706,109},{50384016,131},{50823586,101},{50983536,101},{51169296,109},{51443896,143},{51530356,119},{52015596,101},{52486476,109},{52946076,103},{52967176,113},{53153836,101},{53521906,129},{53729686,107},{53751096,103},{54186526,125},{54445596,103},{54581046,107},{54760476,115},{54881956,113},{54996396,113},{55294996,105},{55333636,107},{55471536,125},{55857676,123},{55978786,129},{56473516,101},{56588686,113},{56593086,113},{57021246,107},{57138186,101},{57271566,125},{57288576,103},{57444996,101},{57542536,101},{57795916,101},{57844866,121},{58076916,103},{58106376,103},{58432926,107},{58574116,107},{58935276,101},{60060256,117},{60327166,129},{61723096,117},{62183766,103},{62234896,111},{62407516,105},{63396486,127},{63921006,101},{64291576,125},{64425726,101},{65264466,115},{65554756,101},{65597806,107},{65700966,131},{65740336,101},{65995476,101},{66082006,105},{66728526,109},{67027206,101},{68447206,147},{68692896,109},{69953626,105},{70275646,131},{70400856,101},{70493796,101},{71076936,107},{71246826,107},{71878936,105},{72099376,105},{72659146,113},{72661896,103},{73123236,103},{73395456,107},{74001466,111},{74409786,101},{74664766,107},{74851986,127},{75337996,131},{75743436,107},{75868536,101},{76199416,119},{76241916,107},{76324576,107},{76605736,111},{76752256,107},{76763946,109},{77038966,105},{77358906,101},{78292806,119},{78390706,101},{79860036,103},{80064816,109},{80590726,123},{81075756,107},{81250996,113},{81604336,111},{81745596,119},{81756816,115},{82051036,113},{82638976,107},{83416126,105},{83784616,117},{83919616,101},{83967586,101},{84482316,101},{84520956,101},{85103976,113},{85409536,117},{85417266,101},{85583956,129},{85818366,101},{85945146,113},{86008566,101},{86225106,137},{86416726,105},{86539186,117},{86586936,107},{86651016,119},{86780106,127},{86883136,105},{86902746,101},{87012976,119},{87246726,101},{87491076,107},{87923746,101},{88077586,107},{88261716,101},{88492116,125},{88513296,103},{88587096,109},{88954366,117},{89042226,115},{89465296,117},{90007126,107},{90221406,103},{90392446,119},{90501016,111},{90663736,131},{91014076,111},{91058026,125},{91075186,119},{91090386,131},{91502796,103},{91637206,129},{91829326,105},{91975996,101},{92403496,111},{92502306,103},{92974176,121},{93263646,139},{93439096,101},{93528156,103},{93632836,125},{93730996,101},{93856926,101},{94641106,101},{95173396,111},{95438086,117},{95537376,101},{96114466,111},{96179826,119},{96330696,109},{96412996,101},{96506236,101},{96520846,101},{96671256,109},{97097856,101},{97579336,105},{97618516,107},{97708386,113},{97768876,137},{98202946,107},{98308596,107},{98357266,129},{98396386,105},{98593216,105},{98875596,121},{99369526,101},{99535216,119}} |