标题:验证孪生素数中点两两和的程序结果和代码
只看楼主
ysr2857
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:767
专家分:65
注 册:2020-2-10
结帖率:100%
 问题点数:0 回复次数:2 
验证孪生素数中点两两和的程序结果和代码
先发一下程序结果:
1与10000之间有205对p,p+2素数对:(只显示孪中数)
/4
/6
/12
/18
/30
/42
/60
/72
/102
/108
/138
/150
/180
/192
/198
/228
/240
/270
/282
/312
/348
/420
/432
/462
/522
/570
/600
/618
/642
/660
/810
/822
/828
/858
/882
/1020
/1032
/1050
/1062
/1092
/1152
/1230
/1278
/1290
/1302
/1320
/1428
/1452
/1482
/1488
/1608
/1620
/1668
/1698
/1722
/1788
/1872
/1878
/1932
/1950
/1998
/2028
/2082
/2088
/2112
/2130
/2142
/2238
/2268
/2310
/2340
/2382
/2550
/2592
/2658
/2688
/2712
/2730
/2790
/2802
/2970
/3000
/3120
/3168
/3252
/3258
/3300
/3330
/3360
/3372
/3390
/3462
/3468
/3528
/3540
/3558
/3582
/3672
/3768
/3822
/3852
/3918
/3930
/4002
/4020
/4050
/4092
/4128
/4158
/4218
/4230
/4242
/4260
/4272
/4338
/4422
/4482
/4518
/4548
/4638
/4650
/4722
/4788
/4800
/4932
/4968
/5010
/5022
/5100
/5232
/5280
/5418
/5442
/5478
/5502
/5520
/5640
/5652
/5658
/5742
/5850
/5868
/5880
/6090
/6132
/6198
/6270
/6300
/6360
/6450
/6552
/6570
/6660
/6690
/6702
/6762
/6780
/6792
/6828
/6870
/6948
/6960
/7128
/7212
/7308
/7332
/7350
/7458
/7488
/7548
/7560
/7590
/7758
/7878
/7950
/8010
/8088
/8220
/8232
/8292
/8388
/8430
/8538
/8598
/8628
/8820
/8838
/8862
/8970
/9000
/9012
/9042
/9240
/9282
/9342
/9420
/9432
/9438
/9462
/9630
/9678
/9720
/9768
/9858
/9930
12/18/24/30/36/42/48/54/60/66/72/78/84/90/102/108/114/120/126/132/
138/144/150/156/162/168/174/180/186/192/198/204/210/216/222/228/234/240/246/252/
258/264/270/276/282/288/294/300/306/312/318/324/330/336/342/348/354/360/366/372/
378/384/390/396/408/414/420/426/432/438/444/450/456/462/468/474/480/486/492/498/
504/510/522/528/534/540/546/552/558/564/570/576/582/588/594/600/606/612/618/624/
630/636/642/648/654/660/666/672/678/684/690/696/702/708/714/720/726/732/738/744/
750/756/762/768/774/780/792/798/804/810/816/822/828/834/840/846/852/858/864/870/
876/882/888/894/900/912/918/924/930/936/942/948/954/960/966/972/978/984/990/996/
1002/1008/1014/1020/1026/1032/1038/1044/1050/1056/1062/1068/1074/1080/1086/1092/1098/1104/1110/1122/
1128/1134/1140/1152/1158/1164/1170/1176/1182/1188/1194/1200/1206/1212/1218/1224/1230/1236/1242/1248/
1254/1260/1272/1278/1284/1290/1296/1302/1308/1314/1320/1326/1332/1338/1344/1350/1362/1368/1374/1380/
1386/1392/1398/1404/1410/1416/1422/1428/1434/1440/1446/1452/1458/1464/1470/1476/1482/1488/1494/1500/
1506/1512/1518/1524/1530/1536/1542/1548/1554/1560/1566/1572/1578/1584/1590/1596/1602/1608/1614/1620/
1626/1632/1638/1644/1650/1656/1662/1668/1674/1680/1686/1692/1698/1704/1710/1716/1722/1728/1734/1740/
1746/1752/1758/1764/1770/1776/1782/1788/1794/1800/1806/1812/1818/1824/1830/1836/1842/1848/1854/1860/
1866/1872/1878/1884/1890/1896/1902/1908/1914/1920/1926/1932/1938/1944/1950/1956/1962/1968/1974/1980/
1986/1992/1998/2004/2010/2016/2022/2028/2034/2040/2046/2052/2058/2064/2070/2076/2082/2088/2094/2100/
2106/2112/2118/2124/2130/2136/2142/2148/2154/2160/2166/2172/2178/2184/2190/2196/2202/2208/2214/2220/
2226/2232/2238/2244/2250/2256/2262/2268/2274/2280/2286/2292/2298/2304/2310/2316/2322/2328/2334/2340/
2346/2352/2358/2364/2370/2376/2382/2388/2394/2400/2406/2412/2418/2424/2430/2436/2442/2448/2454/2460/
2466/2472/2478/2484/2490/2496/2502/2508/2514/2520/2526/2532/2538/2544/2550/2556/2562/2568/2574/2580/
2586/2592/2598/2604/2610/2616/2622/2628/2634/2640/2646/2652/2658/2664/2670/2676/2682/2688/2694/2700/
2706/2712/2718/2724/2730/2736/2742/2748/2754/2760/2766/2772/2778/2784/2790/2796/2802/2808/2814/2820/
2826/2832/2838/2844/2850/2856/2862/2868/2874/2880/2886/2892/2898/2904/2910/2916/2922/2928/2934/2940/
2946/2952/2958/2964/2970/2976/2982/2988/2994/3000/3006/3012/3018/3024/3030/3036/3042/3048/3054/3060/
3066/3072/3078/3084/3090/3096/3102/3108/3114/3120/3126/3132/3138/3144/3150/3156/3162/3168/3174/3180/
3186/3192/3198/3204/3210/3216/3222/3228/3234/3240/3252/3258/3264/3270/3276/3282/3288/3294/3300/3306/
3312/3318/3324/3330/3336/3342/3348/3354/3360/3366/3372/3378/3384/3390/3396/3402/3408/3414/3420/3426/
3432/3438/3444/3450/3456/3462/3468/3474/3480/3486/3492/3498/3504/3510/3516/3522/3528/3534/3540/3546/
3552/3558/3564/3570/3576/3582/3588/3594/3600/3606/3612/3618/3624/3630/3636/3642/3648/3654/3660/3666/
3672/3678/3684/3690/3696/3702/3708/3714/3720/3726/3732/3738/3744/3750/3756/3762/3768/3774/3780/3786/
3792/3798/3804/3810/3816/3822/3828/3834/3840/3846/3852/3858/3864/3870/3876/3882/3888/3894/3900/3906/
3912/3918/3924/3930/3936/3942/3948/3954/3960/3966/3972/3978/3984/3990/3996/4002/4008/4014/4020/4026/
4032/4038/4044/4050/4056/4062/4068/4074/4080/4086/4092/4098/4104/4110/4116/4122/4128/4134/4140/4146/
4152/4158/4164/4170/4176/4182/4188/4194/4200/4212/4218/4224/4230/4236/4242/4248/4254/4260/4266/4272/
4278/4284/4290/4296/4302/4308/4314/4320/4326/4332/4338/4344/4350/4356/4362/4368/4374/4380/4386/4392/
4398/4404/4410/4416/4422/4428/4434/4440/4446/4452/4458/4464/4470/4476/4482/4488/4494/4500/4506/4512/
4518/4524/4530/4536/4542/4548/4554/4560/4566/4572/4578/4584/4590/4596/4602/4608/4614/4620/4626/4632/
4638/4644/4650/4656/4662/4668/4674/4680/4686/4692/4698/4704/4710/4716/4722/4728/4734/4740/4746/4752/
4758/4764/4770/4776/4782/4788/4794/4800/4806/4812/4818/4824/4830/4836/4842/4848/4854/4860/4866/4872/
4878/4884/4890/4896/4902/4908/4914/4920/4926/4932/4938/4944/4950/4956/4962/4968/4974/4980/4986/4992/
4998/5004/5010/5016/5022/5028/5034/5040/5046/5052/5058/5064/5070/5076/5082/5088/5094/5100/5106/5112/
5118/5124/5130/5136/5142/5148/5154/5160/5166/5172/5178/5184/5190/5196/5202/5208/5214/5220/5226/5232/
5238/5244/5250/5256/5262/5268/5274/5280/5286/5292/5298/5304/5310/5316/5322/5328/5334/5340/5346/5352/
5358/5364/5370/5376/5382/5388/5394/5400/5406/5412/5418/5424/5430/5436/5442/5448/5454/5460/5466/5472/
5478/5484/5490/5496/5502/5508/5514/5520/5526/5532/5538/5544/5550/5556/5562/5568/5574/5580/5586/5592/
5598/5604/5610/5616/5622/5628/5634/5640/5646/5652/5658/5664/5670/5676/5682/5688/5694/5700/5706/5712/
5718/5724/5730/5736/5742/5748/5754/5760/5766/5772/5778/5784/5790/5796/5802/5808/5814/5820/5826/5832/
5838/5844/5850/5856/5862/5868/5874/5880/5886/5892/5898/5904/5910/5916/5922/5928/5934/5940/5946/5952/
5958/5964/5970/5976/5982/5988/5994/6000/6006/6012/6018/6024/6030/6036/6042/6048/6054/6060/6066/6072/
6078/6084/6090/6096/6102/6108/6114/6120/6126/6132/6138/6144/6150/6156/6162/6168/6174/6180/6186/6192/
6198/6204/6210/6216/6222/6228/6234/6240/6246/6252/6258/6264/6270/6276/6282/6288/6294/6300/6306/6312/
6318/6324/6330/6336/6342/6348/6354/6360/6366/6372/6378/6384/6390/6396/6402/6408/6414/6420/6426/6432/
6438/6444/6450/6456/6462/6468/6474/6480/6486/6492/6498/6504/6510/6516/6522/6528/6534/6540/6546/6552/
6558/6564/6570/6576/6582/6588/6594/6600/6606/6612/6618/6624/6630/6636/6642/6648/6654/6660/6666/6672/
6678/6684/6690/6696/6702/6708/6714/6720/6726/6732/6738/6744/6750/6756/6762/6768/6774/6780/6786/6792/
6798/6804/6810/6816/6822/6828/6834/6840/6846/6852/6858/6864/6870/6876/6882/6888/6894/6900/6906/6912/
6918/6924/6930/6936/6942/6948/6954/6960/6966/6972/6978/6984/6990/6996/7002/7008/7014/7020/7026/7032/
7038/7044/7050/7056/7062/7068/7074/7080/7086/7092/7098/7104/7110/7116/7122/7128/7134/7140/7146/7152/
7158/7164/7170/7176/7182/7188/7194/7200/7206/7212/7218/7224/7230/7236/7242/7248/7254/7260/7266/7272/
7278/7284/7290/7296/7302/7308/7314/7320/7326/7332/7338/7344/7350/7356/7362/7368/7374/7380/7386/7392/
7398/7404/7410/7416/7422/7428/7434/7440/7446/7452/7458/7464/7470/7476/7482/7488/7494/7500/7506/7512/
7518/7524/7530/7536/7542/7548/7554/7560/7566/7572/7578/7584/7590/7596/7602/7608/7614/7620/7626/7632/
7638/7644/7650/7656/7662/7668/7674/7680/7686/7692/7698/7704/7710/7716/7722/7728/7734/7740/7746/7752/
7758/7764/7770/7776/7782/7788/7794/7800/7806/7812/7818/7824/7830/7836/7842/7848/7854/7860/7866/7872/
7878/7884/7890/7896/7902/7908/7914/7920/7926/7932/7938/7944/7950/7956/7962/7968/7974/7980/7986/7992/
7998/8004/8010/8016/8022/8028/8034/8040/8046/8052/8058/8064/8070/8076/8082/8088/8094/8100/8106/8112/
8118/8124/8130/8136/8142/8148/8154/8160/8166/8172/8178/8184/8190/8196/8202/8208/8214/8220/8226/8232/
8238/8244/8250/8256/8262/8268/8274/8280/8286/8292/8298/8304/8310/8316/8322/8328/8334/8340/8346/8352/
8358/8364/8370/8376/8382/8388/8394/8400/8406/8412/8418/8424/8430/8436/8442/8448/8454/8460/8466/8472/
8478/8484/8490/8496/8502/8508/8514/8520/8526/8532/8538/8544/8550/8556/8562/8568/8574/8580/8586/8592/
8598/8604/8610/8616/8622/8628/8634/8640/8646/8652/8658/8664/8670/8676/8682/8688/8694/8700/8706/8712/
8718/8724/8730/8736/8742/8748/8754/8760/8766/8772/8778/8784/8790/8796/8802/8808/8814/8820/8826/8832/
8838/8844/8850/8856/8862/8868/8874/8880/8886/8892/8898/8904/8910/8916/8922/8928/8934/8940/8946/8952/
8958/8964/8970/8976/8982/8988/8994/9000/9006/9012/9018/9024/9030/9036/9042/9048/9054/9060/9066/9072/
9078/9084/9090/9096/9102/9108/9114/9120/9126/9132/9138/9144/9150/9156/9162/9168/9174/9180/9186/9192/
9198/9204/9210/9216/9222/9228/9234/9240/9246/9252/9258/9264/9270/9276/9282/9288/9294/9300/9306/9312/
9318/9324/9330/9336/9342/9348/9354/9360/9366/9372/9378/9384/9390/9396/9402/9408/9414/9420/9426/9432/
9438/9444/9450/9456/9462/9468/9474/9480/9486/9492/9498/9504/9510/9516/9522/9528/9534/9540/9546/9552/
9558/9564/9570/9576/9582/9588/9594/9600/9606/9612/9618/9624/9630/9636/9642/9648/9654/9660/9666/9672/
9678/9684/9690/9696/9702/9708/9714/9720/9726/9732/9738/9744/9750/9756/9762/9768/9774/9780/9786/9792/
9798/9804/9810/9816/9822/9828/9834/9840/9846/9852/9858/9864/9870/9876/9882/9888/9894/9900/9906/9912/
9918/9924/9930/9936/9942/9948/9954/9960/9966/9972/9978/9984/9990/9996/10002/10008/10014/10020/10026/10032/
10038/10044/10050/10056/10062/10068/10074/10080/10086/10092/10098/10104/10110/10116/10122/10128/10134/10140/10146/10152/
10158/10164/10170/10176/10182/10188/10194/10200/10206/10212/10218/10224/10230/10236/10242/10248/10254/10260/10266/10272/
10278/10284/10290/10296/10302/10308/10314/10320/10326/10332/10338/10344/10350/10356/10362/10368/10374/10380/10386/10392/
10398/10404/10410/10416/10422/10428/10434/10440/10446/10452/10458/10464/10470/10476/10482/10488/10494/10500/10506/10512/
10518/10524/10530/10536/10542/10548/10554/10560/10566/10572/10578/10584/10590/10596/10602/10608/10614/10620/10626/10632/
10638/10644/10650/10656/10662/10668/10674/10680/10686/10692/10698/10704/10710/10716/10722/10728/10734/10740/10746/10752/
10758/10764/10770/10776/10782/10788/10794/10800/10806/10812/10818/10824/10830/10836/10842/10848/10854/10860/10866/10872/
10878/10884/10890/10896/10902/10908/10914/10920/10926/10932/10938/10944/10950/10956/10962/10968/10974/10980/10986/10992/
10998/11004/11010/11016/11022/11028/11034/11040/11046/11052/11058/11064/11070/11076/11082/11088/11094/11100/11106/11112/
11118/11124/11130/11136/11142/11148/11154/11160/11166/11172/11178/11184/11190/11196/11202/11208/11214/11220/11226/11232/
11238/11244/11250/11256/11262/11268/11274/11280/11286/11292/11298/11304/11310/11316/11322/11328/11334/11340/11346/11352/
11358/11364/11370/11376/11382/11388/11394/11400/11406/11412/11418/11424/11430/11436/11442/11448/11454/11460/11466/11472/
11478/11484/11490/11496/11502/11508/11514/11520/11526/11532/11538/11544/11550/11556/11562/11568/11574/11580/11586/11592/
11598/11604/11610/11616/11622/11628/11634/11640/11646/11652/11658/11664/11670/11676/11682/11688/11694/11700/11706/11712/
11718/11724/11730/11736/11742/11748/11754/11760/11766/11772/11778/11784/11790/11796/11802/11808/11814/11820/11826/11832/
11838/11844/11850/11856/11862/11868/11874/11880/11886/11892/11898/11904/11910/11916/11922/11928/11934/11940/11946/11952/
11958/11964/11970/11976/11982/11988/11994/12000/12006/12012/12018/12024/12030/12036/12042/12048/12054/12060/12066/12072/
12078/12084/12090/12096/12102/12108/12114/12120/12126/12132/12138/12144/12150/12156/12162/12168/12174/12180/12186/12192/
12198/12204/12210/12216/12222/12228/12234/12240/12246/12252/12258/12264/12270/12276/12282/12288/12294/12300/12306/12312/
12318/12324/12330/12336/12342/12348/12354/12360/12366/12372/12378/12384/12390/12396/12402/12408/12414/12420/12426/12432/
12438/12444/12450/12456/12462/12468/12474/12480/12486/12492/12498/12504/12510/12516/12522/12528/12534/12540/12546/12552/
12558/12564/12570/12582/12588/12594/12600/12606/12612/12618/12624/12630/12636/12642/12648/12654/12660/12666/12672/12678/
12684/12690/12696/12702/12708/12714/12720/12726/12732/12738/12744/12750/12756/12762/12768/12774/12780/12786/12792/12798/
12804/12810/12816/12822/12828/12834/12840/12846/12852/12858/12864/12870/12876/12882/12888/12894/12900/12906/12912/12918/
12924/12930/12936/12942/12948/12954/12960/12966/12972/12978/12984/12990/12996/13002/13008/13014/13020/13026/13032/13038/
13044/13050/13056/13062/13068/13074/13080/13086/13092/13098/13104/13110/13116/13122/13128/13134/13140/13146/13152/13158/
13164/13170/13176/13182/13188/13194/13200/13206/13212/13218/13224/13230/13236/13242/13248/13254/13260/13266/13272/13278/
13284/13290/13296/13302/13308/13314/13320/13326/13332/13338/13344/13350/13356/13362/13368/13374/13380/13386/13392/13398/
13404/13410/13416/13422/13428/13434/13440/13446/13452/13458/13464/13470/13476/13482/13488/13494/13500/13506/13512/13518/
13524/13530/13536/13542/13548/13554/13560/13566/13572/13578/13584/13590/13596/13602/13608/13614/13620/13626/13632/13638/
13650/13656/13662/13668/13674/13680/13686/13692/13698/13704/13710/13722/13728/13734/13740/13746/13752/13758/13764/13770/
13776/13782/13788/13794/13800/13806/13812/13818/13824/13830/13836/13842/13848/13854/13860/13866/13872/13878/13884/13890/
13896/13902/13908/13914/13920/13926/13932/13938/13944/13950/13956/13962/13968/13974/13980/13986/13992/13998/14004/14010/
14016/14022/14028/14034/14040/14046/14052/14058/14064/14070/14076/14082/14088/14094/14100/14106/14112/14118/14124/14130/
14136/14142/14148/14154/14160/14172/14178/14184/14190/14196/14202/14208/14214/14220/14226/14232/14238/14244/14250/14256/
14262/14268/14274/14280/14286/14292/14298/14304/14310/14316/14322/14328/14340/14352/14358/14364/14370/14376/14382/14388/
14394/14400/14406/14412/14418/14424/14430/14436/14442/14448/14454/14460/14466/14472/14478/14484/14490/14496/14502/14508/
14514/14520/14532/14538/14544/14550/14556/14562/14568/14574/14580/14586/14592/14598/14604/14610/14616/14622/14628/14640/
14646/14652/14658/14664/14670/14676/14682/14688/14694/14700/14706/14712/14718/14724/14730/14736/14742/14748/14754/14760/
14766/14772/14778/14784/14790/14796/14802/14808/14820/14826/14838/14844/14850/14856/14862/14868/14874/14880/14886/14892/
14898/14904/14910/14916/14922/14928/14934/14940/14946/14952/14958/14964/14970/14976/14982/14988/14994/15000/15006/15012/
15018/15024/15030/15036/15048/15054/15060/15066/15072/15078/15084/15090/15096/15102/15108/15114/15120/15132/15138/15144/
15150/15156/15162/15168/15174/15180/15186/15192/15198/15204/15210/15216/15222/15228/15240/15246/15252/15258/15270/15276/
15282/15288/15300/15306/15312/15318/15330/15336/15342/15348/15360/15366/15372/15378/15390/15396/15402/15408/15414/15420/
15426/15432/15438/15444/15450/15456/15462/15468/15474/15480/15486/15492/15498/15504/15510/15516/15522/15528/15540/15546/
15552/15558/15564/15570/15576/15582/15588/15594/15600/15612/15618/15624/15630/15636/15642/15648/15654/15660/15666/15672/
15678/15690/15696/15702/15708/15714/15720/15726/15732/15738/15744/15750/15756/15762/15768/15774/15780/15786/15792/15798/
15804/15810/15822/15828/15834/15840/15846/15852/15858/15870/15876/15882/15888/15894/15900/15906/15912/15918/15930/15936/
15942/15948/15960/15966/15972/15978/15984/15990/15996/16002/16008/16014/16020/16026/16032/16038/16044/16050/16056/16062/
16068/16074/16080/16086/16092/16098/16104/16110/16116/16122/16128/16134/16140/16146/16152/16158/16164/16170/16176/16182/
16188/16194/16200/16212/16218/16224/16230/16242/16248/16254/16260/16266/16272/16278/16290/16296/16302/16308/16320/16326/
16332/16338/16344/16350/16356/16362/16368/16374/16380/16386/16392/16398/16410/16416/16422/16428/16440/16452/16458/16464/
16470/16476/16482/16488/16494/16500/16506/16512/16518/16524/16530/16548/16554/16560/16566/16572/16578/16584/16590/16596/
16602/16608/16614/16620/16626/16632/16638/16644/16650/16662/16668/16674/16680/16686/16692/16698/16710/16716/16722/16728/
16740/16746/16752/16758/16764/16770/16776/16782/16788/16794/16800/16806/16812/16818/16830/16842/16848/16860/16872/16878/
16890/16896/16902/16908/16920/16926/16932/16938/16950/16962/16968/16980/16986/16992/16998/17010/17016/17022/17028/17040/
17052/17058/17070/17076/17082/17088/17094/17100/17112/17118/17130/17136/17142/17154/17160/17166/17178/17190/17196/17202/
17208/17220/17226/17232/17238/17244/17250/17256/17262/17268/17274/17280/17292/17298/17304/17310/17316/17328/17334/17340/
17346/17352/17358/17370/17376/17382/17388/17400/17406/17412/17418/17430/17436/17442/17448/17460/17466/17472/17478/17490/
17502/17508/17514/17520/17526/17532/17538/17550/17556/17562/17568/17574/17580/17598/17610/17616/17628/17634/17640/17646/
17652/17658/17664/17670/17676/17682/17688/17694/17700/17712/17718/17724/17730/17736/17754/17766/17772/17778/17790/17808/
17820/17826/17832/17838/17850/17856/17862/17868/17874/17880/17892/17898/17904/17910/17922/17940/17946/17952/17958/17970/
17976/17982/17988/18000/18012/18018/18024/18030/18036/18042/18048/18054/18060/18066/18078/18084/18090/18102/18108/18120/
18144/18150/18156/18162/18168/18180/18198/18204/18210/18216/18222/18228/18240/18246/18252/18258/18270/18276/18282/18288/
18294/18300/18306/18312/18318/18324/18342/18348/18354/18360/18366/18384/18390/18396/18402/18408/18420/18432/18438/18444/
18450/18456/18462/18468/18474/18480/18486/18492/18498/18504/18516/18522/18528/18540/18558/18564/18582/18588/18600/18606/
18624/18630/18642/18648/18660/18672/18678/18684/18690/18696/18702/18714/18720/18732/18738/18744/18750/18762/18768/18774/
18780/18792/18804/18810/18828/18840/18852/18858/18864/18870/18876/18882/18894/18900/18912/18918/18924/18930/18942/18960/
18972/19002/19008/19020/19050/19062/19068/19092/19098/19110/19116/19140/19152/19158/19170/19182/19188/19200/19206/19212/
19230/19260/19272/19278/19290/19296/19308/19320/19350/19356/19362/19368/19392/19398/19440/19446/19488/19536/19560/19578/
19608/19626/19650/19698/19716/19788/19860/
结果显示除了如下12个数值,能被6整除的大于0的偶数被全覆盖了,这12个数如下:6,96,402,516,786,
906,1116,1146,1266,1356,3246,4206。(其他的在10000内不缺少了,仅考察10000内的)
查前面孪中数表,除了6以外,其他都不是孪中数。则孪中数除了6以外被全覆盖。

[此贴子已经被作者于2020-8-27 14:18编辑过]

搜索更多相关主题的帖子: 孪生素数 代码 验证 结果 其他 孪生素数 其他 验证 代码 结果 
2020-08-26 21:51
ysr2857
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:767
专家分:65
注 册:2020-2-10
得分:0 
Private Sub Command1_Click()
Dim a, b
a = Val(Text1)
a1 = a
Q = Val(Text2)
m = Sqr(Q)
If Right(a, 1) Mod 2 = 0 Then
a = a + 1
Else
a = a
End If
s = 0
Do While a <= m
b = a + 2
c = fenjieyinzi0(Val(a))
d = fenjieyinzi0(Val(b))
If InStr(c, "*") = 0 And InStr(d, "*") = 0 Then
s = s + 1
Print a, b, a + 1
Text3 = Text3 & "/" & a + 1 & vbCrLf
Else
s = s
End If
a = a + 2
Loop
a2 = a
s1 = s
Do While a2 <= Q
B1 = a2 + 2
c1 = fenjieyinzi0(Val(a2))
D1 = fenjieyinzi0(Val(B1))

If InStr(c1, "*") = 0 And InStr(D1, "*") = 0 Then
s1 = s1 + 1
Print a2, B1, a2 + 1
Text3 = Text3 & "/" & a2 + 1 & vbCrLf
Else
s1 = s1
End If
a2 = a2 + 2

Loop
Combo1 = a1 & "与" & Q & "之间有" & s1 & "对p,p+2素数对:" & vbCrLf & Text3
s103 = DeleteSpace1(Text3)
s103 = Mid(s103, 3)
Dim i As Integer
Dim ak(), s105, cr(), f
Set f = CreateObject("Scripting.Dictionary")
s105 = Split(s103, "/")
   j1 = UBound(s105)
   Print j1
   For k = 1 To j1
      n1 = n1 + 1
       ReDim Preserve ak(1 To n1)
      ak(n1) = s105(n1)
    Next
    Print ak(1)
     n = 0
        For k = 1 To j1
           For i = 1 To j1
             n = n + 1
             ReDim Preserve cr(1 To n)
            m = Val(ak(k)) + Val(ak(i))
            f(m) = ""
      Next
    Next
      n = 0
      m = f.Keys
      For i = 0 To f.Count - 1
          ReDim Preserve cr(1 To i + 1)
          cr(i + 1) = m(i)
      Next
     For i = 1 To UBound(cr) - 1
        For j = i + 1 To UBound(cr)
            If cr(i) > cr(j) Then
                temp = cr(j)
                cr(j) = cr(i)
                cr(i) = temp  'c数组是排序好的
            End If
        Next j
        
       ' If i Mod 20 = 0 Then
       ' s104 = s104 & temp & "/" & vbCrLf
       ' Else
       ' s104 = s104 & temp & "/"
       ' End If
    Next i
   
      For i = 1 To UBound(cr)
        If i Mod 20 = 0 Then
          s104 = s104 & cr(i) & "/" & vbCrLf
        Else
          s104 = s104 & cr(i) & "/"
        End If
     Next
         Print temp
         MsgBox "ok"
     MsgBox s104  '显示数组
Text4 = s104
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Combo1 = ""
Form1.Cls
End Sub

Private Function fenjieyinzi0(n As String) As String
If Len(n) < 10 Then
fenjieyinzi0 = fenjieyinzi(Trim(n))
Else
Dim a
n = Trim(n)
n1 = MPC(Trim(n), 1)
a = 123
'a为明文
a1 = zzxc(Trim(n), Trim(a))
If Val(a1) > 1 Then
fenjieyinzi0 = a1 & "*"
Else
c = 999
'c为公约
Do While zzxc(Trim(n1), Trim(c)) > 1
c = Val(c - 1)
Loop
d = qniyuan(Trim(c), Trim(n1))
'd为逆元为私钥
a2 = qksmimo(Trim(a), Trim(c), Trim(n))
'a2为密文
a3 = qksmimo(Trim(a2), Trim(d), Trim(n))
If MBJC(Trim(a3), Trim(a)) = 0 Then
fenjieyinzi0 = "这是素数有" & Len(n) & "位"
Else
fenjieyinzi0 = "2*2"
End If
End If
 
 
 End If
End Function



Private Function fenjieyinzi1(a As String) As String
If Len(a) < 6 Then
fenjieyinzi1 = fenjieyinzi(Trim(a))
Else
x = 3
 Do While InStr(MCC(Trim(a), 2), "/") = 0 And MBJC(Trim(a), 4) >= 0
 
  
 If b = 0 Then
fenjieyinzi1 = fenjieyinzi1 & "2"
 b = 1
 Else
 fenjieyinzi1 = fenjieyinzi1 & "*2"
 End If
 a = MCC(Trim(a), 2)
 k = a
  
 Loop
 
Do While MBJC(Trim(a), "0001") > 0
 Do While MBJC(Trim(x), zhengchuqy(MBBC(Trim(a)))) <= 0
 Do While InStr(MCC1(Trim(a), Trim(x)), "/") = 0 And MBJC(Trim(a), MbC(Trim(x), Trim(x))) >= 0
  
 If b = 0 Then
 fenjieyinzi1 = fenjieyinzi1 & x
 b = 1
 Else
 fenjieyinzi1 = fenjieyinzi1 & "*" & x
 End If
 a = MCC1(Trim(a), Trim(x))
 Loop
  
 x = MPC1(Trim(x), 2)
 Loop
  
 k = a
 a = 1
 Loop
  
 If b = 1 Then
 fenjieyinzi1 = fenjieyinzi1 & "*" & k
 Else
 fenjieyinzi1 = "这是一个质数"
 End If
 
 End If
End Function



Private Function fenjieyinzi(sa As String) As String
Dim x, a, b
x = sa
b = Int(Sqr(Val(x)) / 2)
If x = 3 Or x = 2 Then
a = True
Else
If x Mod 2 = 0 Then
a = False
Else

For i = 3 To 2 * b + 1 Step 2
If x Mod i = 0 Then
a = False
Exit For

Else: a = True

End If
Next
End If
End If
If a = True Then
fenjieyinzi = "这是个素数"
Else
fenjieyinzi = "2*2"
End If


End Function
 Public Function DeleteSpace1(Tmp As String) As String
  '删掉字符串中的换行符和空格的程序
  Dim a As String, b As String
Dim i As Long, j As Long, k As Long

a = Tmp
b = ""
k = Len(a)
For i = 1 To k
j = Asc(Mid(a, i))
If j <> 10 And j <> 13 And j <> 32 And j <> Asc(" ") Then '最后一个百条件是全角空格
b = b & Chr(j)
End If
Next
DeleteSpace1 = b
End Function

 Private Function zzxc(sa As String, sb As String) As String
 Dim a, b, c, d, r
  a = Trim(sa)
  b = Trim(sb)
  If Len(a) < 10 And Len(b) < 10 Then
  
  If Val(a) > Val(b) Then
     c = a
     d = b
  Else
     c = b
     d = a
  End If
 Do Until Val(c) Mod Val(d) = 0
     r = c Mod d
     c = d
     d = r
  Loop
  
  Else
  
  If MBJC(Trim(a), Trim(b)) >= 1 Then
  c = a
  d = b
  Else
  c = b
  d = a
  End If
  Do Until zhengchuqyushu(MCC1(Trim(c), Trim(d))) = 0
  r = zhengchuqyushu(MCC1(Trim(c), Trim(d)))
  c = d
  d = r
  Loop
  End If
 
  
  zzxc = d
  
End Function

 Private Function qniyuan(sa As String, sb As String) As String
 Dim n, p, a, b, c, d, r
  n = Trim(sa)
  p = Trim(sb)
  a = 1
  b = 0
  c = 0
  d = 1
  If Len(n) < 10 And Len(p) < 10 Then
  
  If Val(n) > Val(p) Then
     m = n
     Q = p
     s1 = 1
  Else
     m = p
     Q = n
     s1 = 0
  End If
 Do Until Val(m) Mod Val(Q) = 0
    s = m \ Q
     r = m Mod Q
     s1 = s1 + 1
     If s1 Mod 2 = 1 Then
     a = a
     b = a * s + b
     c = c
     d = c * s + d
     Else
     b = b
     a = a + b * s
     d = d
     c = c + d * s
     End If
     m = Q
     Q = r
  Loop
  If Val(a + b * m) = p Then
  b = b
  a = a + b * (m - 1)
  d = d
  c = c + d * (m - 1)
  Else
  If Val(b + a * m) = p Then
  a = a
  b = b + a * m
  c = c
  d = d + c * m
  Else
  b = b
  a = a + b * (m - 1)
  d = d
  c = c + d * (m - 1)
  End If
  End If
 x = (a + b) Mod p
  y = (c + d) Mod n
  
  
  Else
  
  If MBJC(Trim(n), Trim(p)) >= 1 Then
  m = n
  Q = p
  s1 = 1
  Else
  m = p
  Q = n
  s1 = 0
  End If
  Do Until zhengchuqyushu(MCC1(Trim(m), Trim(Q))) = 0
  s = zhengchuqy(MCC1(Trim(m), Trim(Q)))
  r = zhengchuqyushu(MCC1(Trim(m), Trim(Q)))
  s1 = s1 + 1
  If s1 Mod 2 = 1 Then
  a = a
  b = MPC1(MbC(Trim(a), Trim(s)), Trim(b))
  c = c
  d = MPC1(MbC(Trim(c), Trim(s)), Trim(d))
  Else
  b = b
  a = MPC1(Trim(a), MbC(Trim(b), Trim(s)))
  d = d
  c = MPC1(Trim(c), MbC(Trim(d), Trim(s)))
  End If
  
  m = Q
  Q = r
  Loop
  
  If MPC1(Trim(a), MbC(Trim(b), Trim(m))) = p Then
  b = b
  a = MPC1(Trim(a), MbC(Trim(b), MPC(Trim(m), 1)))
  d = d
  c = MPC1(Trim(c), MbC(Trim(d), MPC(Trim(m), 1)))
  Else
  If MPC1(Trim(b), MbC(Trim(a), Trim(m))) = p Then
  a = a
  b = MPC1(Trim(b), MbC(Trim(a), Trim(m)))
  c = c
  d = MPC1(Trim(d), MbC(Trim(c), Trim(m)))
  Else
  b = b
  a = MPC1(Trim(a), MbC(Trim(b), MPC(Trim(m), 1)))
  d = d
  c = MPC1(Trim(c), MbC(Trim(d), MPC(Trim(m), 1)))
  End If
  End If
Do While Left(a, 1) = "0"
    a = Mid(a, 2)
Loop
  
  End If
  
  qniyuan = a
 End Function
 
 Private Function qksmimo(sa As String, sb As String, sc As String) As String
 Dim c, e, n, d
c = Trim(sa)
e = Trim(sb)
n = Trim(sc)
d = 1
If Len(c) < 5 And Len(e) < 5 And Len(n) < 5 Then
c = Val(c): n = Val(n)
Do While e > 0
If Right(e, 1) Mod 2 = 0 Then
c = c * c Mod n
e = e / 2

Else
d = d * c Mod n
e = e - 1
End If
Loop
Else
c = c
Do While MBJC(Trim(e), 1) >= 0
If Right(e, 1) Mod 2 = 0 Then
c = zhengchuqyushu(MCC1(MbC(Trim(c), Trim(c)), Trim(n)))
e = zhengchuqy(MCC1(Trim(e), 2))
Else
d = zhengchuqyushu(MCC1(MbC(Trim(c), Trim(d)), Trim(n)))
e = MPC(Trim(e), 1)
End If
Loop
End If

qksmimo = d
 End Function




Private Function zhengchuqyushu(sa As String) As String
If InStr(sa, "/") = 0 Then
 zhengchuqyushu = 0
 Else
 zhengchuqyushu = Mid(sa, InStr(sa, "/") + 1)
 End If
 

End Function


Private Function zhengchuqy(sa As String) As String
If InStr(sa, "/") = 0 Then
 zhengchuqy = sa
 Else
 zhengchuqy = Left(sa, InStr(sa, "/") - 1)
 End If
 

End Function


Public Function MBBC(D1 As String) As String 'kai pingfang
If Len(D1) < 10 Then
 jss = Int(Sqr(D1))
 JW = Val(D1) - (jss) ^ 2
  If JW = 0 Then
  MBBC = jss
  Else
  MBBC = jss & "/" & JW
    End If
 Else
Dim x 'shuju changdu
x = Len(D1) \ 4
D2 = String(4 - Len(D1) + 4 * x, "0") & D1
Dim a() As String
ReDim a(4 To 4 * x + 4)
Dim b() As String
ReDim b(2 To 2 * x)
Dim i, j, js
  For i = 4 To 4 * x + 4 Step 4
  
a(i) = Mid(D2, i - 3, 4)
js = Int(Sqr(Val(a(4) & a(8))))
 JW = Val(a(4) & a(8)) - (js) ^ 2
 Next
   j = 4
   Do While j <= 2 * x
   
   jws = MPC1(JW & "0000", a(2 * j + 4))
   If MBJC(Trim(jws), MbC(Trim(js), 200)) <= 0 Then
    b(j) = "00"
    Else
    jwc = Left(jws, Len(jws) - Len(MbC(Trim(js), 200)) + 2) \ Left(MbC(Trim(js), 200), 2)
    If Len(jwc) > 2 Then
     b(j) = 99
     Else
     b(j) = jwc
     End If
   
     
     Do While MBJC(Trim(jws), MbC(MPC1(b(j), MbC(Trim(js), 200)), b(j))) = -1
     
     b(j) = b(j) - 1
     
               Loop
          End If
          JW = MPC(Trim(jws), MbC(MPC1(MbC(200, Trim(js)), b(j)), b(j)))
      
     js = MPC1(MbC(Trim(js), 100), Trim(b(j)))
     
      
   j = j + 2
   If JW = 0 Then
      
   MBBC = js
   Else
   MBBC = js & "/" & JW
   End If
   Loop
   
 End If
End Function

Public Function MBJC(D1 As String, D2 As String) As String ';bijiao
If Len(D1) <= 10 And Len(D2) <= 10 Then
If Val(D1) > Val(D2) Then
MBJC = 1
Else
If Val(D1) = Val(D2) Then
MBJC = 0
Else
MBJC = -1
End If
End If
Else

If Len(D1) > Len(D2) Then
MBJC = 1
Else
If Len(D1) < Len(D2) Then
MBJC = -1
Else
If Len(D1) = Len(D2) Then
 Dim x, y
 x = Len(D1) \ 4: y = Len(D2) \ 4
 Dim a() As String, b() As String
 ReDim a(4 To 4 * x + 4)
 ReDim b(4 To 4 * y + 4)
 If Val(Left(D1, Len(D1) - 4 * x)) > Val(Left(D2, Len(D2) - 4 * y)) Then
  MBJC = 1
  Else
  If Val(Left(D1, Len(D1) - 4 * x)) < Val(Left(D2, Len(D2) - 4 * y)) Then
  MBJC = -1
  Else
  For i = 4 To 4 * x Step 4
  a(i) = Mid(D1, Len(D1) - i + 1, 4)
  b(i) = Mid(D2, Len(D2) - i + 1, 4)
  Next
  j = 4 * x
  Do While a(j) = b(j) And j >= 8
  
  j = j - 4
     Loop
     
     
   If Val(a(j)) - Val(b(j)) > 0 Then
   MBJC = 1
   Else
   If Val(a(j)) - Val(b(j)) < 0 Then
   MBJC = -1
   Else
   MBJC = 0
   End If
   
  End If
  
  
  
 End If
End If
End If
End If
End If
End If
End Function

Public Function MCC(D1 As String, D2 As String) As String ';除数少于8位的除法
If Len(D1) < Len(D2) Then
   MCC = "0" & "/" & D1
   Else
   If Len(D1) < 9 Then
    MCC = Val(D1) \ Val(D2) & "/" & Val(D1) - (Val(D1) \ Val(D2)) * Val(D2)
     If Mid(MCC, InStr(MCC, "/") + 1) = 0 Then
  MCC = Left(MCC, InStr(MCC, "/") - 1)
 Else
MCC = MCC
End If
   
    Else
   
   Dim x ';fen duan changdu
   x = Len(D1)
   
     
   
     Dim a() As String
      ReDim a(1 To x)  ';定义数组的储存空间
      For i = 1 To x Step 1  ';把被除数各位放在a()中
       a(i) = Mid(D1, i, 1)
        
      
       Next i
      Dim b() As String
      JW = 0
     ReDim b(1 To x)
     For j = 1 To x Step 1
    b(j) = Val(JW & a(j)) \ Val(D2)
      JW = Val(JW & a(j)) - Val(b(j)) * Val(D2)
       Next j
       For r = 1 To x
       If JW = 0 Then
          MCC = MCC & b(r)
          Else
          CJ = CJ & b(r)
          MCC = CJ & "/" & JW
      
    End If
   
    For i = 1 To Len(MCC)
   If Not Mid(MCC, i, 1) = "0" Then
       Exit For
   End If
Next
strtmp = Mid(MCC, i)
 If Len(strtmp) = 0 Then
 MCC = "0"
 Else
MCC = strtmp
End If
   
   Next
   
   End If
     
     End If
   
End Function
 
 Public Function MCC1(D1 As String, D2 As String) As String ';大整数的除法
Dim ss
 ss = MBJC(D1, D2)
If ss = -1 Then
 MCC1 = "0" & "/" & D1
  Else
  If ss = 0 Then
   MCC1 = 1
   Else
   If Len(D1) = Len(D2) Then
     s = Val(Left(D1, 1)) \ Val(Left(D2, 1))
 
 Do While MBJC(MbC(Trim(s), Trim(D2)), D1) = 1
  s = s - 1
  Loop
  If MBJC(MbC(Trim(s), Trim(D2)), D1) = 0 Then
   MCC1 = s
   Else
   MCC1 = s & "/" & MPC(Trim(D1), MbC(Trim(s), Trim(D2)))
 
 End If
    Else
    If Len(D2) < 9 Then
     MCC1 = MCC(D1, D2)
     Else
    Dim x, y ';定义分段长度
    x = Len(D1): y = Len(D2)
   
Dim JW, jcc, jss, jcs
 
  Dim a() As String, b() As String
  
  ReDim a(1 To x)
  ReDim b(1 To y)
  For i = 1 To x
  a(i) = Mid(D1, i, 1)
  Next
  For j = 1 To y
  b(j) = Mid(D2, j, 1)
  Next
  jcc = Val(a(1) & a(2)) \ Val(b(1) & b(2))
   
      
        
  jss = MbC(Trim(jcc), D2)
   For i1 = 1 To y
    jws = jws & a(i1)
      Next
      
      Do While MBJC(Trim(jws), Trim(jss)) = -1
      jcc = jcc - 1
      jss = MbC(Trim(jcc), D2)
      Loop
  JW = MPC(Trim(jws), Trim(jss))
  
    z = x - y
   
    Dim c() As String
    ReDim c(1 To z)
    For s = 1 To z
     If MBJC(JW & a(s + y), D2) = -1 Then
       c(s) = "0"
       Else
     jwc = Val(Left(JW & a(s + y), 3)) \ Val(Left(D2, 2))
      If Len(jwc) > 1 Then
      c(s) = "9"
       Else
        c(s) = jwc
         End If
      
     Do While MBJC(JW & a(s + y), MbC(Val(c(s)), D2)) = -1
    c(s) = Right(10000 + Val(c(s) - 1), 1)
     Loop
     End If
   
     JW = MPC(JW & a(s + y), MbC(Val(c(s)), D2))
     
    jcc = jcc & c(s)
    Next s
    If JW = 0 Then
    MCC1 = jcc
    Else
    MCC1 = jcc & "/" & JW
    End If
   
  For i = 1 To Len(MCC1)
    If Not Mid(MCC1, i, 1) = "0" Then
        Exit For
    End If
Next
strtmp = Mid(MCC1, i)
  If Len(strtmp) = 0 Then
  MCC1 = "0"
  Else
MCC1 = strtmp
 End If
   
   
   
    End If
   
   
   
   
   
  
  End If
End If
End If
End Function
Public Function MbC(D1 As String, D2 As String) As String '乘法
Dim x, y '两数长度
x = Len(D1): y = Len(D2)
Dim a() As Integer
ReDim a(1 To x + y, 1 To y)
Dim i, j, c1, C2, CJ, JW
For j = y To 1 Step -1 'D2
JW = 0 '进位清0
C2 = Mid$(D2, j, 1) '每位数
For i = x To 1 Step -1 'D1
  c1 = Mid$(D1, i, 1) '每位数
  CJ = c1 * C2 + JW '计算乘积
  c = i + j: r = y + 1 - j
  a(c, r) = CJ Mod 10 '本位
  JW = CJ \ 10 '进位
Next
a(c - 1, r) = JW
Next
Dim b() As Integer
ReDim b(1 To x + y)
JW = 0
For i = x + y To 1 Step -1
Bit = JW
For j = 1 To y
  Bit = Bit + a(i, j)
Next
b(i) = Bit Mod 10
JW = Bit \ 10
Next
If b(1) > 0 Then
MbC = MbC & b(1)
Else
MbC = MbC
End If
For i = 2 To x + y
MbC = MbC & b(i)
Next
End Function

 Public Function MPC(D1 As String, D2 As String) As String ';jianfaqi
Dim x, y ';两数长度
If Len(D1) >= Len(D2) Then
D4 = String(Len(D1) - Len(D2), "0") & D2
D3 = D1
Else
D4 = D2
D3 = String(Len(D2) - Len(D1), "0") & D1
End If
x = Len(D3): y = Len(D4)
Dim a() As Integer, B1() As Integer, c1() As Integer, E1() As Integer
ReDim a(1 To x)
ReDim B1(1 To y)
ReDim c1(1 To x)
ReDim E1(1 To x)
Dim i, j, C2, CJ, JW
For j = y To 1 Step -1 ';D2
JW = 1 ';yu jie weichuzhi
B1(j) = Mid(D4, j, 1) ';每位数
For i = x To 1 Step -1  ';D1
   a(i) = Mid(D3, i, 1) ';每位数
   c1(i) = 10 + a(i) - B1(i) - 1 + JW ';计算jia
   JW = c1(i) \ 10
   E1(i) = c1(i) Mod 10
  Next
  Next
  For r = 1 To x
  MPC = MPC & E1(r)
  For i = 1 To Len(MPC)
    If Not Mid(MPC, i, 1) = "0" Then
        Exit For
    End If
Next
strtmp = Mid(MPC, i)
  If Len(strtmp) = 0 Then
  MPC = "0"
  Else
MPC = strtmp
End If
  Next
  
  
End Function
  Public Function MPC1(D1 As String, D2 As String) As String 'jiafa
Dim x, y '两数长度

If Len(D1) >= Len(D2) Then
D4 = String(Len(D1) - Len(D2), "0") & D2
D3 = D1
Else
D4 = D2
D3 = String(Len(D2) - Len(D1), "0") & D1
End If
x = Len(D3): y = Len(D4)
Dim a() As Integer, B1() As Integer, c1() As Integer, E1() As Integer
ReDim a(1 To x)
ReDim B1(1 To y)
ReDim c1(1 To x)
ReDim E1(1 To x)
Dim i, j, C2, CJ, JW
For j = y To 1 Step -1 'D2
JW = 0 '进位清0
B1(j) = Mid$(D4, j, 1) '每位数
For i = x To 1 Step -1  'D1
   a(i) = Mid$(D3, i, 1) '每位数
   c1(i) = a(i) + B1(i) + JW '计算jia
   JW = c1(i) \ 10
   E1(i) = c1(i) Mod 10
  Next
  Next
  For r = 1 To x
  If JW = 0 Then
  MPC1 = MPC1 & E1(r)
  Else
  jc = jc & E1(r)
  MPC1 = JW & jc
  End If
  Next
  
End Function


2020-08-26 21:53
ysr2857
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:767
专家分:65
注 册:2020-2-10
得分:0 
不会快速乘法除法程序,希望老师指点!谢谢!
2020-08-26 22:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-502964-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.052789 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved