Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Arithmetic-Rational/F-Sharp/arithmetic-rational.fs
Normal file
5
Task/Arithmetic-Rational/F-Sharp/arithmetic-rational.fs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
type frac = Microsoft.FSharp.Math.BigRational
|
||||
|
||||
let perf n = 1N = List.fold (+) 0N (List.map (fun i -> if n % i = 0 then 1N/frac.FromInt(i) else 0N) [2..n])
|
||||
|
||||
for i in 1..(1<<<19) do if (perf i) then printfn "%i is perfect" i
|
||||
Loading…
Add table
Add a link
Reference in a new issue