Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
27
Task/Blum-integer/Frink/blum-integer.frink
Normal file
27
Task/Blum-integer/Frink/blum-integer.frink
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue