Euclid-Mullin sequence: Difference between revisions
→{{header|F_Sharp|F#}}: Idiotmatically use an active pattern
(→{{header|F_Sharp|F#}}: Idiotmatically use an active pattern) |
|||
Line 21:
<lang fsharp>
//Euclid-Mullin sequence. Nigel Galloway: October 29th., 2021
let(|Prime|_|)(n,g)=if Open.Numeric.Primes.MillerRabin.IsProbablePrime &g then Some(n*g,n*g+1I) else None
let n=Seq.unfold(fun(n,g)->match
n|>Seq.take 16|>Seq.iter(printfn "%A")
</lang>
|