n番目の素数は、どのくらいの大きさなのか。
n番目の素数をPnとすると、
Pn ≈ log2n!
となるようです。
n!の近似式、スターリングの近似式と、その式の精度を上げる方法を書きました。
n! ≈ √2nπ・(n/e)n・{m}
mで精度を上げることが出来ます。
とりあえず、m=1としておきます。
どちらの式をみても、
n番目の素数の近似式で、なんでlogの底が2なんだろうとか、
n!のの近似式で、なんでルート、つまり1/2乗が出てくるんだろうとか、
不思議な感じがします。
これら2式より、
Pn ≈ n・log2(n/e)+(1/2)・log22nπ
もし、近似式の精度をあげる必要があるならば、
Pn ≈ n・log2(n/e)+(1/2)・log22nπ+log2m
となるだろうが、あまり意味をなさないかもしれません。
さて、実際にどれくらい精度があるのかを見てみると、
1 | 2 | -0.12 | -0.058473 |
2 | 3 | 0.94 | 0.313453 |
3 | 5 | 2.55 | 0.509006 |
4 | 7 | 4.55 | 0.650710 |
5 | 11 | 6.88 | 0.625716 |
6 | 13 | 9.47 | 0.728603 |
7 | 17 | 12.28 | 0.722473 |
8 | 19 | 15.28 | 0.804431 |
9 | 23 | 18.46 | 0.802425 |
10 | 29 | 21.78 | 0.751001 |
11 | 31 | 25.24 | 0.814180 |
12 | 37 | 28.83 | 0.779066 |
13 | 41 | 32.53 | 0.793333 |
14 | 43 | 36.33 | 0.844992 |
15 | 47 | 40.24 | 0.856215 |
16 | 53 | 44.24 | 0.834767 |
17 | 59 | 48.33 | 0.819162 |
18 | 61 | 52.50 | 0.860670 |
19 | 67 | 56.75 | 0.847002 |
20 | 71 | 61.07 | 0.860160 |
21 | 73 | 65.46 | 0.896767 |
22 | 79 | 69.92 | 0.885110 |
23 | 83 | 74.45 | 0.896957 |
24 | 89 | 79.03 | 0.888007 |
25 | 97 | 83.68 | 0.862646 |
26 | 101 | 88.38 | 0.875023 |
27 | 103 | 93.13 | 0.904198 |
28 | 107 | 97.94 | 0.915326 |
29 | 109 | 102.80 | 0.943101 |
30 | 113 | 107.71 | 0.953142 |
31 | 127 | 112.66 | 0.887082 |
32 | 131 | 117.66 | 0.898164 |
33 | 137 | 122.70 | 0.895650 |
34 | 139 | 127.79 | 0.919364 |
35 | 149 | 132.92 | 0.892087 |
36 | 151 | 138.09 | 0.914510 |
37 | 157 | 143.30 | 0.912742 |
38 | 163 | 148.55 | 0.911341 |
39 | 167 | 153.83 | 0.921162 |
40 | 173 | 159.16 | 0.919977 |
41 | 179 | 164.51 | 0.919071 |
42 | 181 | 169.91 | 0.938707 |
43 | 191 | 175.33 | 0.917971 |
44 | 193 | 180.79 | 0.936745 |
45 | 197 | 186.28 | 0.945603 |
46 | 199 | 191.81 | 0.963856 |
47 | 211 | 197.36 | 0.935365 |
48 | 223 | 202.95 | 0.910077 |
49 | 227 | 208.56 | 0.918775 |
50 | 229 | 214.21 | 0.935396 |
51 | 233 | 219.88 | 0.943683 |
52 | 239 | 225.58 | 0.943844 |
53 | 241 | 231.31 | 0.959779 |
54 | 251 | 237.06 | 0.944468 |
55 | 257 | 242.84 | 0.944914 |
56 | 263 | 248.65 | 0.945439 |
57 | 269 | 254.48 | 0.946035 |
58 | 271 | 260.34 | 0.960669 |
59 | 277 | 266.22 | 0.961097 |
60 | 281 | 272.13 | 0.968437 |
61 | 283 | 278.06 | 0.982550 |
62 | 293 | 284.02 | 0.969338 |
63 | 307 | 289.99 | 0.944603 |
64 | 311 | 295.99 | 0.951747 |
65 | 313 | 302.02 | 0.964906 |
66 | 317 | 308.06 | 0.971798 |
67 | 331 | 314.13 | 0.949022 |
68 | 337 | 320.21 | 0.950189 |
69 | 347 | 326.32 | 0.940410 |
70 | 349 | 332.45 | 0.952583 |
71 | 353 | 338.60 | 0.959211 |
72 | 359 | 344.77 | 0.960366 |
73 | 367 | 350.96 | 0.956297 |
74 | 373 | 357.17 | 0.957562 |
75 | 379 | 363.40 | 0.958838 |
76 | 383 | 369.65 | 0.965137 |
77 | 389 | 375.91 | 0.966360 |
78 | 397 | 382.20 | 0.962719 |
79 | 401 | 388.50 | 0.968836 |
80 | 409 | 394.83 | 0.965343 |
81 | 419 | 401.17 | 0.957435 |
82 | 421 | 407.52 | 0.967988 |
83 | 431 | 413.90 | 0.960320 |
84 | 433 | 420.29 | 0.970647 |
85 | 439 | 426.70 | 0.971981 |
86 | 443 | 433.13 | 0.977711 |
87 | 449 | 439.57 | 0.978995 |
88 | 457 | 446.03 | 0.975992 |
89 | 461 | 452.50 | 0.981571 |
90 | 463 | 459.00 | 0.991352 |
91 | 467 | 465.50 | 0.996796 |
92 | 479 | 472.03 | 0.985443 |
93 | 487 | 478.57 | 0.982683 |
94 | 491 | 485.12 | 0.988027 |
95 | 499 | 491.69 | 0.985353 |
96 | 503 | 498.28 | 0.990608 |
97 | 509 | 504.88 | 0.991898 |
98 | 521 | 511.49 | 0.981748 |
99 | 523 | 518.12 | 0.990669 |
100 | 541 | 524.76 | 0.969989 |
101 | 547 | 531.42 | 0.971521 |
102 | 557 | 538.09 | 0.966058 |
103 | 563 | 544.78 | 0.967639 |
104 | 569 | 551.48 | 0.969212 |
105 | 571 | 558.20 | 0.977576 |
106 | 577 | 564.92 | 0.979070 |
107 | 587 | 571.67 | 0.973876 |
108 | 593 | 578.42 | 0.975413 |
109 | 599 | 585.19 | 0.976942 |
110 | 601 | 591.97 | 0.984974 |
111 | 607 | 598.76 | 0.986432 |
112 | 613 | 605.57 | 0.987881 |
113 | 617 | 612.39 | 0.992531 |
114 | 619 | 619.22 | 1.000363 |
115 | 631 | 626.07 | 0.992187 |
116 | 641 | 632.93 | 0.987407 |
117 | 643 | 639.80 | 0.995021 |
118 | 647 | 646.68 | 0.999507 |
119 | 653 | 653.58 | 1.000882 |
120 | 659 | 660.48 | 1.002250 |
121 | 661 | 667.40 | 1.009685 |
122 | 673 | 674.33 | 1.001980 |
123 | 677 | 681.27 | 1.006314 |
124 | 683 | 688.23 | 1.007656 |
125 | 691 | 695.19 | 1.006071 |
126 | 701 | 702.17 | 1.001672 |
127 | 709 | 709.16 | 1.000227 |
128 | 719 | 716.16 | 0.996051 |
129 | 727 | 723.17 | 0.994735 |
130 | 733 | 730.19 | 0.996172 |
131 | 739 | 737.23 | 0.997602 |
132 | 743 | 744.27 | 1.001712 |
133 | 751 | 751.33 | 1.000436 |
134 | 757 | 758.39 | 1.001841 |
135 | 761 | 765.47 | 1.005874 |
136 | 769 | 772.56 | 1.004627 |
137 | 773 | 779.66 | 1.008611 |
138 | 787 | 786.76 | 0.999701 |
139 | 797 | 793.88 | 0.996090 |
140 | 809 | 801.01 | 0.990127 |
141 | 811 | 808.15 | 0.996489 |
142 | 821 | 815.30 | 0.993060 |
143 | 823 | 822.46 | 0.999346 |
144 | 827 | 829.63 | 1.003182 |
145 | 829 | 836.81 | 1.009423 |
146 | 839 | 844.00 | 1.005961 |
147 | 853 | 851.20 | 0.997891 |
148 | 857 | 858.41 | 1.001646 |
149 | 859 | 865.63 | 1.007718 |
150 | 863 | 872.86 | 1.011424 |
151 | 877 | 880.10 | 1.003531 |
152 | 881 | 887.35 | 1.007202 |
153 | 883 | 894.60 | 1.013140 |
154 | 887 | 901.87 | 1.016764 |
155 | 907 | 909.15 | 1.002365 |
156 | 911 | 916.43 | 1.005961 |
157 | 919 | 923.73 | 1.005142 |
158 | 929 | 931.03 | 1.002184 |
159 | 937 | 938.34 | 1.001432 |
160 | 941 | 945.66 | 1.004956 |
161 | 947 | 952.99 | 1.006330 |
162 | 953 | 960.33 | 1.007697 |
163 | 967 | 967.68 | 1.000707 |
164 | 971 | 975.04 | 1.004162 |
165 | 977 | 982.41 | 1.005535 |
166 | 983 | 989.78 | 1.006900 |
167 | 991 | 997.17 | 1.006222 |
168 | 997 | 1004.56 | 1.007581 |
169 | 1009 | 1011.96 | 1.002933 |
170 | 1013 | 1019.37 | 1.006287 |
171 | 1019 | 1026.79 | 1.007641 |
172 | 1021 | 1034.21 | 1.012941 |
173 | 1031 | 1041.65 | 1.010327 |
174 | 1033 | 1049.09 | 1.015576 |
175 | 1039 | 1056.54 | 1.016883 |
176 | 1049 | 1064.00 | 1.014300 |
177 | 1051 | 1071.47 | 1.019475 |
178 | 1061 | 1078.94 | 1.016913 |
179 | 1063 | 1086.43 | 1.022040 |
180 | 1069 | 1093.92 | 1.023312 |
181 | 1087 | 1101.42 | 1.013266 |
182 | 1091 | 1108.93 | 1.016432 |
183 | 1093 | 1116.44 | 1.021449 |
184 | 1097 | 1123.97 | 1.024583 |
185 | 1103 | 1131.50 | 1.025837 |
186 | 1109 | 1139.04 | 1.027085 |
187 | 1117 | 1146.58 | 1.026486 |
188 | 1123 | 1154.14 | 1.027728 |
189 | 1129 | 1161.70 | 1.028965 |
190 | 1151 | 1169.27 | 1.015874 |
191 | 1153 | 1176.85 | 1.020684 |
192 | 1163 | 1184.43 | 1.018430 |
193 | 1171 | 1192.03 | 1.017956 |
194 | 1181 | 1199.63 | 1.015771 |
195 | 1187 | 1207.23 | 1.017046 |
196 | 1193 | 1214.85 | 1.018313 |
197 | 1201 | 1222.47 | 1.017877 |
198 | 1213 | 1230.10 | 1.014097 |
199 | 1217 | 1237.74 | 1.017039 |
200 | 1223 | 1245.38 | 1.018299 |
300 | 1987 | 2041.28 | 1.027316 |
400 | 2741 | 2886.11 | 1.052941 |
500 | 3571 | 3767.35 | 1.054986 |
1000 | 7919 | 8529.40 | 1.077080 |
2000 | 17389 | 19052.99 | 1.095692 |
3000 | 27449 | 30331.26 | 1.105004 |
4000 | 37813 | 42099.67 | 1.113365 |
5000 | 48611 | 54232.56 | 1.115644 |
10000 | 104729 | 118458.14 | 1.131092 |
20000 | 224737 | 256908.82 | 1.143153 |
30000 | 350377 | 402908.16 | 1.149928 |
40000 | 479909 | 553809.66 | 1.153989 |
50000 | 611953 | 708356.40 | 1.157534 |
100000 | 1299709 | 1516704.17 | 1.166957 |
200000 | 2750159 | 3233399.22 | 1.175714 |
300000 | 4256233 | 5025582.80 | 1.180758 |
400000 | 5800079 | 6866788.80 | 1.183913 |
500000 | 7368787 | 8744447.56 | 1.186688 |
1000000 | 15485863 | 18488884.82 | 1.193920 |
2000000 | 32452843 | 38977758.85 | 1.201058 |
3000000 | 49979687 | 60221520.17 | 1.204920 |
4000000 | 67867967 | 81955506.41 | 1.207573 |
5000000 | 86028121 | 104054020.57 | 1.209535 |
10000000 | 179424673 | 218108029.19 | 1.215597 |
20000000 | 373587883 | 456216045.92 | 1.221175 |
30000000 | 573259391 | 701872937.47 | 1.224355 |
40000000 | 776531401 | 952432078.89 | 1.226521 |
50000000 | 982451653 | 1206636500.02 | 1.228189 |
思ったよりも精度が出ないですね。
ではでは