Last active
February 2, 2025 19:55
-
-
Save originalsouth/26eb8841748926fd36dc0dfe6ee34c69 to your computer and use it in GitHub Desktop.
Yet another belphegor's prime script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env julia | |
using DataStructures | |
using Primes | |
using Statistics | |
belphegor(x::Integer) = parse(BigInt,(z -> "1$(z)666$(z)1")("0"^x)) | |
buf = CircularBuffer{Float64}(100) | |
for i in 0:10^4 | |
n = belphegor(i) | |
t = @elapsed test = isprime(n) | |
push!(buf, t) | |
if test | |
print(" "^32*"\r") | |
println(i) | |
else | |
print("$i (10^$(round(log10(mean(buf)); digits = 2))s)"*" "^8*"\r") | |
end | |
end | |
exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment