-bash-3.1$ gcc -O2 -lm tp64.c -o tp64 -bash-3.1$ ./tp64 -h Usage: tp64 endNumber <= 103079215104 (malloc:4096MB) -o file output primes to file -n no-output (only total count) -p n print n+n pairs of twin primes -s print sieve process -h help
-bash-3.1$ time ./tp64 100000000 Succeded malloc (4166667 bytes). start: size=4166667, pmint=10001, pmax=99999997 makeBitTable: 16665000 pairs in [10001. ... ,99999997] end: psieve=9973 440107 twin primes in [10001..100000000]. 440311 twin primes in [5..100000000]. (99999587,99999589) real 0m0.230s user 0m0.220s sys 0m0.010s
n | N=10^n | V=#{(6*m-1,6*m+1) ∈[{sqrt(N)}..N]2 : mは自然数} 篩にかける前の(6*m±1)の組数 |
U=#{(p,p+2) ∈[{sqrt(N)}..N]2 : pは素数} 篩にかけた後(双子素数)の組数 |
U/V 全ての素数 p∈[5..[sqrt(N)]]で 篩をかけて残った組の 比率 |
Uの最小の双子素数 [>=sqrt(N)] |
Uの最大の双子素数 [<=N] |
#{(p,p+2)∈[3..N]2 : pは素数} N以下の双子素数の組数 [(3,5)を含む] |
2 | 100 | 15 | 6 | 0.40000000000000000 | (11, 13) | (71, 73) | 8 |
3 | 1000 | 161 | 30 | 0.18633540372670807 | (41, 43) | (881, 883) | 35 |
4 | 10000 | 1650 | 197 | 0.11939393939393939 | (101, 103) | (9929, 9931) | 205 |
5 | 100000 | 16614 | 1204 | 0.07246900204646683 | (347, 349) | (99989, 99991) | 1224 |
6 | 1000000 | 166500 | 8134 | 0.04885285285285285 | (1019, 1021) | (999959, 999961) | 8169 |
7 | 10000000 | 1666140 | 58897 | 0.03534937040104673 | (3167, 3169) | (9999971, 9999973) | 58980 |
8 | 100000000 | 16665000 | 440107 | 0.02640906090609060 | (10007, 10009) | (99999587. 99999589) | 440312 |
9 | 10000000000 | 166661396 | 3424019 | 0.02054476370760748 | (31721, 31723) | (999999191, 999999193) | 3424506 |
10 | 100000000000 | 1666650000 | 27411455 | 0.01644703747037470 | (100151, 100153) | (9999999701, 9999999703) | 27412679 |
11 | 1000000000000 | 16666613962 | 224372915 | 0.01346241747193352 | (316241, 316243) | (99999999761, 99999999763) | 224376048 |
Last Update: 2021.11.03 |
H.Nakao |