Jump to content

Wieferich primes: Difference between revisions

Realize in F#
m (Fix typo throughout, I misspelled it in the first place)
(Realize in F#)
Line 82:
</pre>
 
=={{header|F_Sharp|F#}}==
This task uses [http://www.rosettacode.org/wiki/Extensible_prime_generator#The_functions Extensible Prime Generator (F#)]
<lang fsharp>
// Weiferich primes: Nigel Galloway. June 2nd., 2021
primes32()|>Seq.takeWhile((>)5000)|>Seq.filter(fun n->(2I**(n-1)-1I)%(bigint(n*n))=0I)|>Seq.iter(printfn "%d")
</lang>
{{out}}
<pre>
1093
3511
Real: 00:00:00.004
</pre>
=={{header|Factor}}==
{{works with|Factor|0.99 2021-02-05}}
2,172

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.