- 注册时间
- 2020-11-9
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 3824
- 在线时间
- 小时
|
发表于 2021-1-9 11:58:20
|
显示全部楼层
本帖最后由 uk702 于 2021-1-9 12:06 编辑
我用 julia 写了程序楞算,概率至少 > 0.232323,并且不是随着 n 增加而严格递增
n = 10000000, t = 0.2322919
n = 11000000, t = 0.2322950909090909
n = 12000000, t = 0.23229758333333334
n = 13000000, t = 0.23229561538461538
n = 14000000, t = 0.2322962142857143
n = 15000000, t = 0.23229826666666667
n = 16000000, t = 0.232299125
n = 17000000, t = 0.23229911764705882
n = 18000000, t = 0.23230083333333335
n = 19000000, t = 0.23230373684210526
n = 20000000, t = 0.23230505
n = 21000000, t = 0.23230633333333334
n = 22000000, t = 0.23230577272727274
n = 23000000, t = 0.2323062608695652
n = 24000000, t = 0.232308625
n = 25000000, t = 0.23230984
n = 26000000, t = 0.23230926923076922
n = 27000000, t = 0.23230948148148148
n = 28000000, t = 0.23231017857142858
- using Primes
- function factors(n)
- f = [one(n)]
- for (p,e) in factor(n)
- f = reduce(vcat, [f*p^j for j in 1:e], init=f)
- end
- return length(f) == 1 ? [one(n), n] : sort!(f)
- end
- t = 0
- i = 1
- while true
- a = factors(i)
- for u=1:length(a)
- for v=u+1:length(a)
- if a[u]+a[v] in a
- # println((i, a[u], a[v]))
- global t = t+1
- @goto _next
- end
- end
- end
- @label _next
- global i=i+1
- if i % 1000000 == 0 println("n = $i, t = $(t/i)") end
- end
复制代码 |
|