Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,26 @@
import "/fmt" for Fmt
var isPrime = Fn.new { |n|
if (n < 2 || !n.isInteger) return false
if (n%2 == 0) return n == 2
if (n%3 == 0) return n == 3
var d = 5
while (d*d <= n) {
if (n%d == 0) return false
d = d + 2
if (n%d == 0) return false
d = d + 4
}
return true
}
var count = 0
var i = 42
while (count < 42) {
if (isPrime.call(i)) {
count = count + 1
System.print("%(Fmt.d(2, count)): %(Fmt.dc(18, i))")
i = 2 * i - 1
}
i = i + 1
}