versioninfo() using Distributed addprocs() @show nprocs() @show nworkers() @everywhere using Random @everywhere function ntoone(rng=Random.default_rng()) s = rand(rng) for n in Base.Iterators.countfrom(2) s += rand(rng) s < 1 || return n end end function estimate_e(N=10^6; rngfunc=Random.default_rng) S = @distributed (+) for _ in 1:N ntoone(rngfunc()) end S / N end estimate_e(10) @time estimate_e(10^8) @time estimate_e(10^9) @time estimate_e(10^10)