Wieferich primes: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Fix typo throughout, I misspelled it in the first place) |
(Realize in F#) |
||
Line 82: | Line 82: | ||
</pre> |
</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}}== |
=={{header|Factor}}== |
||
{{works with|Factor|0.99 2021-02-05}} |
{{works with|Factor|0.99 2021-02-05}} |