1 / n の性質について(4)
n が99...9 の約数のとき、
1 / n の小数表示が面白い。
require 'bigdecimal'
def A(n)
puts "1/#{n}"
if n == 1
print "= 0." + "9" * 50
else
print "= " + BigDecimal(1r / n, 50).to_s("F")[0..51]
end
puts "..."
end
def B(n)
m = 10 ** n - 1
(1..Math.sqrt(m)).each{|i|
if m % i == 0
A(i)
A(m / i)
end
}
end
(1..7).each{|i| B(i)}
出力結果
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/99
= 0.01010101010101010101010101010101010101010101010101...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/33
= 0.03030303030303030303030303030303030303030303030303...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/11
= 0.09090909090909090909090909090909090909090909090909...
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/999
= 0.00100100100100100100100100100100100100100100100100...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/333
= 0.00300300300300300300300300300300300300300300300300...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/111
= 0.00900900900900900900900900900900900900900900900900...
1/27
= 0.03703703703703703703703703703703703703703703703703...
1/37
= 0.02702702702702702702702702702702702702702702702702...
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/9999
= 0.00010001000100010001000100010001000100010001000100...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/3333
= 0.00030003000300030003000300030003000300030003000300...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/1111
= 0.00090009000900090009000900090009000900090009000900...
1/11
= 0.09090909090909090909090909090909090909090909090909...
1/909
= 0.00110011001100110011001100110011001100110011001100...
1/33
= 0.03030303030303030303030303030303030303030303030303...
1/303
= 0.00330033003300330033003300330033003300330033003300...
1/99
= 0.01010101010101010101010101010101010101010101010101...
1/101
= 0.00990099009900990099009900990099009900990099009900...
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/99999
= 0.00001000010000100001000010000100001000010000100001...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/33333
= 0.00003000030000300003000030000300003000030000300003...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/11111
= 0.00009000090000900009000090000900009000090000900009...
1/41
= 0.02439024390243902439024390243902439024390243902439...
1/2439
= 0.00041000410004100041000410004100041000410004100041...
1/123
= 0.00813008130081300813008130081300813008130081300813...
1/813
= 0.00123001230012300123001230012300123001230012300123...
1/271
= 0.00369003690036900369003690036900369003690036900369...
1/369
= 0.00271002710027100271002710027100271002710027100271...
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/999999
= 0.00000100000100000100000100000100000100000100000100...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/333333
= 0.00000300000300000300000300000300000300000300000300...
1/7
= 0.14285714285714285714285714285714285714285714285714...
1/142857
= 0.00000700000700000700000700000700000700000700000700...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/111111
= 0.00000900000900000900000900000900000900000900000900...
1/11
= 0.09090909090909090909090909090909090909090909090909...
1/90909
= 0.00001100001100001100001100001100001100001100001100...
1/13
= 0.07692307692307692307692307692307692307692307692307...
1/76923
= 0.00001300001300001300001300001300001300001300001300...
1/21
= 0.04761904761904761904761904761904761904761904761904...
1/47619
= 0.00002100002100002100002100002100002100002100002100...
1/27
= 0.03703703703703703703703703703703703703703703703703...
1/37037
= 0.00002700002700002700002700002700002700002700002700...
1/33
= 0.03030303030303030303030303030303030303030303030303...
1/30303
= 0.00003300003300003300003300003300003300003300003300...
1/37
= 0.02702702702702702702702702702702702702702702702702...
1/27027
= 0.00003700003700003700003700003700003700003700003700...
1/39
= 0.02564102564102564102564102564102564102564102564102...
1/25641
= 0.00003900003900003900003900003900003900003900003900...
1/63
= 0.01587301587301587301587301587301587301587301587301...
1/15873
= 0.00006300006300006300006300006300006300006300006300...
1/77
= 0.01298701298701298701298701298701298701298701298701...
1/12987
= 0.00007700007700007700007700007700007700007700007700...
1/91
= 0.01098901098901098901098901098901098901098901098901...
1/10989
= 0.00009100009100009100009100009100009100009100009100...
1/99
= 0.01010101010101010101010101010101010101010101010101...
1/10101
= 0.00009900009900009900009900009900009900009900009900...
1/111
= 0.00900900900900900900900900900900900900900900900900...
1/9009
= 0.00011100011100011100011100011100011100011100011100...
1/117
= 0.00854700854700854700854700854700854700854700854700...
1/8547
= 0.00011700011700011700011700011700011700011700011700...
1/143
= 0.00699300699300699300699300699300699300699300699300...
1/6993
= 0.00014300014300014300014300014300014300014300014300...
1/189
= 0.00529100529100529100529100529100529100529100529100...
1/5291
= 0.00018900018900018900018900018900018900018900018900...
1/231
= 0.00432900432900432900432900432900432900432900432900...
1/4329
= 0.00023100023100023100023100023100023100023100023100...
1/259
= 0.00386100386100386100386100386100386100386100386100...
1/3861
= 0.00025900025900025900025900025900025900025900025900...
1/273
= 0.00366300366300366300366300366300366300366300366300...
1/3663
= 0.00027300027300027300027300027300027300027300027300...
1/297
= 0.00336700336700336700336700336700336700336700336700...
1/3367
= 0.00029700029700029700029700029700029700029700029700...
1/333
= 0.00300300300300300300300300300300300300300300300300...
1/3003
= 0.00033300033300033300033300033300033300033300033300...
1/351
= 0.00284900284900284900284900284900284900284900284900...
1/2849
= 0.00035100035100035100035100035100035100035100035100...
1/407
= 0.00245700245700245700245700245700245700245700245700...
1/2457
= 0.00040700040700040700040700040700040700040700040700...
1/429
= 0.00233100233100233100233100233100233100233100233100...
1/2331
= 0.00042900042900042900042900042900042900042900042900...
1/481
= 0.00207900207900207900207900207900207900207900207900...
1/2079
= 0.00048100048100048100048100048100048100048100048100...
1/693
= 0.00144300144300144300144300144300144300144300144300...
1/1443
= 0.00069300069300069300069300069300069300069300069300...
1/777
= 0.00128700128700128700128700128700128700128700128700...
1/1287
= 0.00077700077700077700077700077700077700077700077700...
1/819
= 0.00122100122100122100122100122100122100122100122100...
1/1221
= 0.00081900081900081900081900081900081900081900081900...
1/999
= 0.00100100100100100100100100100100100100100100100100...
1/1001
= 0.00099900099900099900099900099900099900099900099900...
1/1
= 0.99999999999999999999999999999999999999999999999999...
1/9999999
= 0.00000010000001000000100000010000001000000100000010...
1/3
= 0.33333333333333333333333333333333333333333333333333...
1/3333333
= 0.00000030000003000000300000030000003000000300000030...
1/9
= 0.11111111111111111111111111111111111111111111111111...
1/1111111
= 0.00000090000009000000900000090000009000000900000090...
1/239
= 0.00418410041841004184100418410041841004184100418410...
1/41841
= 0.00002390000239000023900002390000239000023900002390...
1/717
= 0.00139470013947001394700139470013947001394700139470...
1/13947
= 0.00007170000717000071700007170000717000071700007170...
1/2151
= 0.00046490004649000464900046490004649000464900046490...
1/4649
= 0.00021510002151000215100021510002151000215100021510...
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。