まず、1000以下の 4N+1 の形の合同数124個をデータとしてセットするプログラムを用意する。
10 L%=123:dim G%(L%):for I%=1 to L%:read A%:G%(I%)=A%:next I% 20 data 5,13,21,29,37,41,53,61,65,69,77,85,93,101,109,133,137,141 30 data 145,149,157,161,165,173,181,197,205,213,221,229,237,253,257 40 data 265,269,277,285,293,301,309,313,317,341,349,353,357,365,373 50 data 381,389,397,413,421,429,437,445,453,457,461,465,469,485,493 60 data 501,505,509,517,533,541,557,561,565,573,581,589,597,609,613 70 data 629,645,653,661,669,677,685,689,701,709,717,721,733,741,749 80 data 757,761,773,777,781,789,793,797,805,813,821,829,853,861,869 90 data 877,885,889,893,901,905,917,933,941,949,957,965,973,985,989,997
これを、x、y、gのループの、gのループ部分として append する。
プログラムは以下のとおり。
10 print=print+"g_brute3.txt" 20 ' g_brute3.ub 30 M%=32767 40 L%=124:dim G%(L%):gosub 270:' set congruum into g%() 50 ' 60 for Y%=905 to M% step 4:Y2=Y%^2 70 for I%=1 to L%:G=G%(I%)*Y2:if G%(I%)@8=5 then 160 80 Xe=isqrt(G) 90 for X=4 to Xe step 4 100 if or{gcd(X,Y%)>1,gcd(X,G%(I%))>1} then 150 else X2=X^2 110 W2=G-X2:if W2<0 then cancel for:goto 240 120 W=isqrt(W2):if res>0 then 150 130 Z=isqrt(X2+G):if res>0 then 150 140 gosub 380 150 next X:goto 240 160 Xe=isqrt(G) 170 for X=2 to Xe step 4 180 if or{gcd(X,Y%)>1,gcd(X,G%(I%))>1} then 230 else X2=X^2 190 W2=G-X2:if W2<0 then cancel for:goto 240 200 W=isqrt(W2):if res>0 then 230 210 Z=isqrt(X2+G):if res>0 then 230 220 gosub 380 230 next X 240 next I% 250 next Y% 260 end 270 ' congruum 280 for I%=1 to L%:read A%:G%(I%)=A%:next I%:return 290 data 5,13,21,29,37,41,53,61,65,69,77,85,93,101,109,133,137,141 300 data 145,149,157,161,165,173,181,197,205,213,221,229,237,253,257 310 data 265,269,277,285,293,301,309,313,317,341,349,353,357,365,373 320 data 381,389,397,413,421,429,437,445,453,457,461,465,469,485,493 330 data 501,505,509,517,533,541,557,561,565,573,581,589,597,609,613 340 data 629,645,653,661,669,677,685,689,701,709,717,721,733,741,749 350 data 757,761,773,777,781,789,793,797,805,813,821,829,853,861,869 360 data 877,885,889,893,901,905,917,933,941,949,957,965,973,985,989,997 370 ' g_prt.ub 380 print G%(I%);":";X;",";Y%;",";Z;",";W;":";G;",";X2;":"; 390 print G%(I%)^2*Y%^2;",";G%(I%)^2*Y%*Z*W;",";X 400 return
10,000以下のyについて調べたところ、新たに以下の5個について解が求められた。
53, 181, 349, 485, 533
実行結果は以下のとおり。
解が依然見つかっていないのは、以下の 121個。
101, 103, 118, 127, 142, 157, 173, 191, 197, 199, 223, 229, 237, 263, 269, 271, 277, 278, 293, 302, 303, 311, 317, 326, 327, 334, 358, 365, 367, 373, 382, 389, 397, 398, 407, 413, 415, 421, 431, 439, 446, 453, 454, 461, 463, 478, 487, 493, 501, 502, 503, 519, 541, 542, 543, 557, 566, 573, 583, 597, 599, 607, 613, 614, 623, 631, 638, 647, 653, 661, 662, 677, 685, 695, 701, 703, 717, 718, 727, 733, 742, 743, 757, 758, 766, 767, 773, 781, 789, 797, 807, 815, 822, 823, 829, 831, 838, 853, 862, 863, 877, 878, 886, 887, 893, 911, 917, 919, 926, 933, 941, 958, 965, 967, 974, 982, 983, 989, 991, 997, 998
前 | この章の目次 | 次 |
---|