Counting Twin Primes in Residue Classes Alex Lemann, Earlham College
Primes Residue classes for n mod 4 • 4 x + 0 = 4 x = 0 , 4 , 8 , 12 , 16 , . . . ≡ 0 mod 4 • 4 x + 1 = 1 , 5 , 9 , 13 , 17 , 21 , 25 , 29 , 33 , 37 , 41 , 45 , 49 , . . . ≡ 1 mod 4 • 4 x + 2 = 2(2 x + 1) = 2 , 6 , 10 , 14 , 18 , . . . ≡ 2 mod 4 • 4 x + 3 = 3 , 7 , 11 , 15 , 19 , 23 , 27 , 31 , 35 , 39 , 43 , 47 , . . . ≡ 3 mod 4
Prime races 18 16 14 12 10 8 6 4 2 0 2000 4000 6000 8000 10000 x Figure 1: The difference between the number of primes which are 3 mod 4 and 1 mod 4 up to x
6 4 2 0 2000 4000 6000 8000 10000 x –2 –4 Figure 2: The difference between the number of primes which are 7 mod 30 and 13 mod 30 up to x
Primes • 4 x + 1 = 1 , 5 , 9 , 13 , 17 , . . . • 4 x + 3 = 3 , 7 , 11 , 15 , 19 , . . . Weighted Count π 4 , 1 > 3 (20) = 1 3 + 1 4 ≈ 0 . 58333 ≈ 0 . 19472 • ln 20 ln 20 π 4 , 3 > 1 (20) = 1 7 + 1 8 + 1 9 + 1 10 + 1 11 + 1 12 + 1 13 + 1 14 + 1 15 + 1 16 + 1 19 + 1 • 20 ≈ ln 20 1 . 03336 ≈ 0 . 34494 ln 20 π 4 , 1=3 (20) = 1 2 + 1 5 + 1 6 + 1 17 + 1 18 ≈ 0 . 98104 ≈ 0 . 32748 • ln 20 ln 20 p k +1 1 i ≈ ln( p k +1 ) − ln ( p k ) + 1 2( 1 1 � ) − p k p k +1 i = p k
Twin Primes: p, p+2 prime. for example, p = 3, p+2 = 5
Assignment Server Worker 1 Twin Worker 2 Network Primes Worker 3 Disk Worker P Figure 3: Interactions between the assignment server and workers
2. Send First Number in Block Assignment 3. Return Size of List Server Worker 1. Read 1. Read 4. Return List of Primes Config Config 5. Write Twin Prime List File File Network Disk Disk Figure 4: Interactions between the assignment server and one worker. The steps are labeled in order. Steps 2 through 5 repeat until there are no blocks remaining
Time 3500 Time 3000 2500 2000 1500 1000 500 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Figure 5: Time in seconds to calculate twin primes out to 10 11 for 1 to 19 worker processors
Speedup 18 Speedup 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Figure 6: Speedup for 1 to 19 worker processors Speedup( p ) =amount of time for one processor / amount of time for p processors
(ln n ) 2 (1 + O ln ln n n n π 2 ( n ) ≤ c Π 2 ln n ) ≈ c Π 2 (ln n ) 2 storage( n ) = 64 π 2 ( n ) n � storage ′ ( n ) = (ln( p k − p k − 1 )) ≈ k =1 n th twin prime ≈ n ln( n ) 2 n (ln( k (ln k ) 2 − ( k − 1)(ln( k − 1)) 2 ) ≈ 2 n ln ln n � k =1
Bit 1 Bit 2 Bit 8 0 0 0 0 0 0 0 0 Storing Two Values Bit 57 Bit 64 0 0 0 0 0 0 1 0 Bit 65 Bit 72 0 1 1 1 0 1 1 0 First Value Bit 73 Bit 80 1 1 0 0 1 0 0 1 Bit 81 Bit 88 Second Value 0 0 0 0 0 1 1 0 Block Size Designator 0 0 One Byte 1 0 Four Bytes Record Size Designator First Number, 13001 = 0011001 011001001 1 1 Eight Bytes 0 1 Two Bytes Second Number, 13007, Stored as a Difference = 0110
Results 1 1,3 > 3,5 3,5 > 1,3 3,5 = 1,3 0.8 0.6 0.4 0.2 0 0 2 4 6 8 10 12 14 16 18 Figure 7: 1 , 3 mod 8 vs 3 , 5 mod 8
Results 1 1,3 > 7,9 7,9 > 1,3 7,9 = 1,3 0.8 0.6 0.4 0.2 0 0 2 4 6 8 10 12 14 16 18 Figure 8: 1 , 3 mod 8 vs 7 , 1 mod 8
Recommend
More recommend