Counting Twin Primes in Residue Classes Alex Lemann, Earlham College - - PowerPoint PPT Presentation
Counting Twin Primes in Residue Classes Alex Lemann, Earlham College - - PowerPoint PPT Presentation
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 , . . .
Primes
Residue classes for n mod 4
- 4x + 0 = 4x = 0, 4, 8, 12, 16, . . . ≡ 0 mod 4
- 4x + 1 = 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, . . . ≡ 1 mod 4
- 4x + 2 = 2(2x + 1) = 2, 6, 10, 14, 18, . . . ≡ 2 mod 4
- 4x + 3 = 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, . . . ≡ 3 mod 4
Prime races
2 4 6 8 10 12 14 16 18 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
–4 –2 2 4 6 2000 4000 6000 8000 10000 x
Figure 2: The difference between the number of primes which are 7 mod 30 and 13 mod 30 up to x
Primes
- 4x + 1 = 1, 5, 9, 13, 17, . . .
- 4x + 3 = 3, 7, 11, 15, 19, . . .
Weighted Count
- π4,1>3(20)
ln 20
= 1
3 + 1 4 ≈ 0.58333 ln20
≈ 0.19472
- π4,3>1(20)
ln20
= 1
7 + 1 8 + 1 9 + 1 10 + 1 11 + 1 12 + 1 13 + 1 14 + 1 15 + 1 16 + 1 19 + 1 20 ≈ 1.03336 ln20
≈ 0.34494
- π4,1=3(20)
ln 20
= 1
2 + 1 5 + 1 6 + 1 17 + 1 18 ≈ 0.98104 ln 20
≈ 0.32748
pk+1
- i=pk
1 i ≈ ln(pk+1) − ln(pk) + 1 2( 1 pk − 1 pk+1 )
Twin Primes: p, p+2 prime. for example, p = 3, p+2 = 5
Assignment Server Disk Twin Primes Network Worker 2 Worker 1 Worker 3 Worker P
Figure 3: Interactions between the assignment server and workers
Assignment Server Disk Disk
- 1. Read
Config File
- 1. Read
Config File Network Worker
- 2. Send First Number in Block
- 3. Return Size of List
- 5. Write Twin Prime List
- 4. Return List of Primes
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
500 1000 1500 2000 2500 3000 3500 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Time
Figure 5: Time in seconds to calculate twin primes out to 1011 for 1 to 19 worker processors
Speedup
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Speedup
Figure 6: Speedup for 1 to 19 worker processors Speedup(p) =amount of time for one processor/amount of time for p processors
π2(n) ≤ cΠ2 n (ln n)2 (1 + Oln ln n ln n ) ≈ cΠ2 n (ln n)2 storage(n) = 64π2(n) storage′ (n) =
n
- k=1
(ln(pk − pk−1)) ≈ nth twin prime ≈ n ln(n)2
n
- k=1
(ln(k(ln k)2 − (k − 1)(ln(k − 1))2) ≈ 2n ln ln n
1 1 1 1 1 1 1 1 1 1 1 1 Bit 81 Bit 88 One Byte Two Bytes 1 Four Bytes 1 Eight Bytes 1 1 Bit 2 Bit 1 Bit 8 Bit 57 Bit 64 Bit 65 Bit 72 Bit 73 Bit 80 Second Value First Value Storing Two Values Record Size Designator Block Size Designator First Number, 13001 = 0011001 011001001 Second Number, 13007, Stored as a Difference = 0110
Results
0.2 0.4 0.6 0.8 1 2 4 6 8 10 12 14 16 18 1,3 > 3,5 3,5 > 1,3 3,5 = 1,3
Figure 7: 1, 3 mod 8 vs 3, 5 mod 8
Results
0.2 0.4 0.6 0.8 1 2 4 6 8 10 12 14 16 18 1,3 > 7,9 7,9 > 1,3 7,9 = 1,3