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$=$l$G$O!"MW5a$5$l$F$$$?7k2L$r5a$a$k%W%m%0%i%`$r:n$m$&!#(B
$B2]Bj(B5B$B$G$d$C$?$h$&$K!"(BFOR NEXT $B$G(B N $B$rBg$-$/$7$F9T$C$F!"(B
$BItJ,OB$r7W;;$9$k%W%m%0%i%`$K$9$k!#(B
$B7k2L$O
$B>/!9;z$,>.$5$/$F8+$E$i$$$,!"(B
$B$N>l9g$K!"(B
$B>.?tE@0J2<(B$B0L$^$G$N>.?tI=<($,0lCW$7$F$$$k$3$H$,J,$+$k!#(B
$B$3$l$G>.?tE@0J2<(B$B0L$^$G$NCM$OF@$i$l$F$$$k$H9M$($FNI$$$@$m$&!#(B
($BMW5a$5$l$F$$$?$N$O!"(B$B0L$^$G$@$C$?$,!"(B$B0L$,(B `8' $B$G!"(B
$B;M
kadai7b1.TXT ( $B$N>l9g(B)
? 210
6*arctan(x)$B"b(B 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798175415515142074668914143478172519579252999001468666117910963800249473594922589558451149412426597243798192135258779349163444188419002776980473968671998254815310845772183661993477117122206330295980300468265032425044971769581966122368923975830190359265260280452439469056239411353322600285365354079198623561329837112540037802583883742612430308012431266108485579200748300447615517051621776071743812297241593061362796460193924590409288715907812776745710640173447366147858476628929330128224069043383756471261001339104089689573643179485746003276589222538648739794448220503879861605852796470434461563725003377966770398821962936563887508996436649003257909678486654464777327912490175223366294675627953729664047127912971230253567836505483256602936448002590856734658997052628800136082809703995747012631975584920533663300884564944271834022542189687366731857503436221868148525708031224234008111518938525225632668655196746
$B&P$H$N:9(B=-3.939E-0103
$B$H(B FOR NEXT $B%k!<%W$K$7$F!"7 $B$N7k2L$rF@$k!#(B
FOR N=10 TO 210 STEP 10
...
NEXT N
kadai7b2.BAS
REM kadai7b2.BAS --- $B%^!<%@%t%!!&%0%l%4%j!.?tE@0J2<(B110$B0L$^$GI=<((B
OPTION ARITHMETIC decimal_high
LET FMT$="N=### -%."&REPEAT$("#",110)
LET N=250
LET X=1/SQR(3)
LET F=-X*X
LET T=X
LET S=0
FOR J=1 TO N
LET A=T/(2*J-1)
LET S=S+A
LET T=F*T
IF MOD(J , 10) =0 THEN
PRINT USING fmt$:J,6*S
END IF
NEXT J
REM $BAH9~$_Dj?t(B PI $B$H$N:9$r7W;;$7$F$_$k(B
PRINT USING "$B&P$H$N:9(B=-%.###^^^^^^":PI-6*S
END
N= 10 3.14159051093808009964275422994425504368823543729459863385301608264097243139275244243408049537664837144194195965
N= 20 3.14159265357140338177371056457791845749708370902558800062450336039110974863967354187227900363909324495379551167
N= 30 3.14159265358979302993126907675698512128890364163387594078160677223250316907504141910094384327780556430672531665
N= 40 3.14159265358979323845998904545815723164682333580898559851810755021711576515774234507828600074005410050567590231
N= 50 3.14159265358979323846264334727215223712766242383933328994947074253583407491260142245980404128750279799354137185
N= 60 3.14159265358979323846264338327899429478611788675967126248193958028428440424653148715465478961463146251880103922
N= 70 3.14159265358979323846264338327950287681011408881114209344980232821142119403271477392517560945005206755050370174
N= 80 3.14159265358979323846264338327950288419705988682105507083891588023987499387955321296887381276928532730590072263
N= 90 3.14159265358979323846264338327950288419716939772598750958858556364736336671762754275139106652717651497248200692
N=100 3.14159265358979323846264338327950288419716939937508067873446993355312916323675359893283010326258393751533470850
N=110 3.14159265358979323846264338327950288419716939937510582058777735023191320405347993715459391151728912750033891584
N=120 3.14159265358979323846264338327950288419716939937510582097493858083854337957828522717360102517299756190923350247
N=130 3.14159265358979323846264338327950288419716939937510582097494459221382757184428319165349115190289161510116917782
N=140 3.14159265358979323846264338327950288419716939937510582097494459230781492806566013451682112808110943615477604646
N=150 3.14159265358979323846264338327950288419716939937510582097494459230781640626284131806763014633707611386690905481
N=160 3.14159265358979323846264338327950288419716939937510582097494459230781640628620862758871391779973144580812870063
N=170 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862212031675396342638517754282
N=180 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803473073620684479093638320
N=190 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534059912106400090011
N=200 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211704355929502943
N=210 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798175415515
N=220 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808014
N=230 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651
N=240 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651
N=250 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651
$B&P$H$N:9(B= 2.722E-0122
$B1_<~N((B $B$N>.?tE@0J2<(B $B0L$^$G(B
3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510
58209 74944 59230 78164 06286 20899 86280 34825 34211 70679
82148 08651
Next: 3.2 AGM, $BBeI=A*
$BJ?@.(B22$BG/(B6$B7n(B24$BF|(B