Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Ascending-primes/F-Sharp/ascending-primes.fs
Normal file
3
Task/Ascending-primes/F-Sharp/ascending-primes.fs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// Ascending primes. Nigel Galloway: April 19th., 2022
|
||||
[2;3;5;7]::List.unfold(fun(n,i)->match n with []->None |_->let n=n|>List.map(fun(n,g)->[for n in n.. -1..1->(n-1,i*n+g)])|>List.concat in Some(n|>List.choose(fun(_,n)->if isPrime n then Some n else None),(n|>List.filter(fst>>(<)0),i*10)))([(2,3);(6,7);(8,9)],10)
|
||||
|>List.concat|>List.sort|>List.iter(printf "%d "); printfn ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue