27 lines
681 B
Text
27 lines
681 B
Text
isBlum = {|x|
|
|
f = factorFlat[x]
|
|
if length[f] != 2
|
|
return false
|
|
|
|
f1 = first[f]
|
|
f2 = last[f]
|
|
return (f1 != f2) and (first[f] mod 4 == 3) and (last[f] mod 4 == 3)
|
|
}
|
|
|
|
println["First 50:"]
|
|
println[first[select[count[1], isBlum], 50]]
|
|
|
|
ret = new array
|
|
for n = [26828, 100000, 200000, 300000, 400000]
|
|
ret.push[["${n}th is: ", nth1[select[count[1], isBlum], n]]]
|
|
|
|
println[formatTable[ret, "right"]]
|
|
|
|
d = new dict
|
|
for n = first[select[count[1], isBlum], 400000]
|
|
d.increment[right[toString[n],1]]
|
|
|
|
println["Distribution of the first 400000 Blum integers:"]
|
|
sum = sum[d.values[]]
|
|
for k = sort[d.keys[]]
|
|
println[formatFix[d@k / sum, "percent", 3] + " end in $k"]
|