Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Ormiston-triples/F-Sharp/ormiston-triples.fs
Normal file
5
Task/Ormiston-triples/F-Sharp/ormiston-triples.fs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// Ormiston triples. Nigel Galloway: February 3rd., 2023
|
||||
let oTriples n=n|>Seq.pairwise|>Seq.filter(fun((n,i),(g,l))->i=g)|>Seq.map(fun((n,i),(g,l))->(n,g,l))
|
||||
primes32()|>oPairs|>oTriples|>Seq.take 25|>Seq.iter(fun(n,_,_)->printf "%d " n); printfn ""
|
||||
printfn $"<100 million: %d{primes32()|>Seq.takeWhile((>)100000000)|>oPairs|>oTriples|>Seq.length}"
|
||||
printfn $"<1 billion: %d{primes32()|>Seq.takeWhile((>)1000000000)|>oPairs|>oTriples|>Seq.length}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue