Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -0,0 +1,31 @@
|
|||
local int = require "int"
|
||||
local fmt = require "fmt"
|
||||
|
||||
local limit <const> = 1e9
|
||||
local gap_starts = {}
|
||||
local primes = int.primes(limit * 5, true, 128 * 1024)
|
||||
for i = 2, #primes do
|
||||
local gap = primes[i] - primes[i - 1]
|
||||
if !gap_starts[gap] then gap_starts[gap] = primes[i - 1] end
|
||||
end
|
||||
local pm = 10
|
||||
local gap1 = 2
|
||||
while true do
|
||||
while !gap_starts[gap1] do gap1 += 2 end
|
||||
local start1 = gap_starts[gap1]
|
||||
local gap2 = gap1 + 2
|
||||
if !gap_starts[gap2] then
|
||||
gap1 = gap2 + 2
|
||||
continue
|
||||
end
|
||||
local start2 = gap_starts[gap2]
|
||||
local diff = math.abs(start2 - start1)
|
||||
if diff > pm then
|
||||
fmt.print("Earliest difference > %,s between adjacent prime gap starting primes:", pm)
|
||||
fmt.print("Gap %d starts at %,s, gap %d starts at %,s, difference is %,s.\n", gap1, start1, gap2, start2, diff)
|
||||
if pm == limit then break end
|
||||
pm *= 10
|
||||
else
|
||||
gap1 = gap2
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Lim ← 2000000
|
||||
Lims ← ⍢(⊸×10|<Lim)10
|
||||
▽⊸≡(=⊣⊸°/×)↘2⇡Lim # primes
|
||||
⊕⊢⊛⊸≡⊢⊏⍏⊸≡⊢⍉⊟⊙(↘¯1)⊸⧈₂/- # [gap first-prime]
|
||||
# Note that negative differences are considered valid so use ⌵ abs.
|
||||
⍉⬚∞⊂⊙⍉⊸⧈₂(⌵⊣/-) # [gap-of-gaps gap first-prime]
|
||||
⊸≡⌞(⊏˜⊟⊸+1˜⨂1⤚≡(<⊢)) ⊙Lims # result
|
||||
≡(
|
||||
⊃($" Difference: _"⊣/-
|
||||
| $"_ and _"∩°□°⊟≡(□$"_(_)_"⊃(⊣|⊡1|/+↙¯2)))
|
||||
$"_ between _"
|
||||
&p$"Distance between adjacent prime gaps > _:\n_"⊃⋅∘∘
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue