Deceptive numbers: Difference between revisions

Content deleted Content added
Petelomax (talk | contribs)
m 91=7*13 in task description, for those of us a bit slow
Realize in F#
Line 66:
</pre>
 
=={{header|F_Sharp|F#}}==
This task uses [http://www.rosettacode.org/wiki/Extensible_prime_generator#The_functions Extensible Prime Generator (F#)]
<lang fsharp>
// Deceptive numbers. Nigel Galloway: February 13th., 2022
Seq.unfold(fun n->Some(n|>Seq.filter(isPrime>>not)|>Seq.filter(fun n->(10I**(n-1)-1I)%(bigint n)=0I),n|>Seq.map((+)30)))(seq{1;7;11;13;17;19;23;29})|>Seq.concat|>Seq.skip 1
|>Seq.chunkBySize 10|>Seq.take 7|>Seq.iter(fun n->n|>Array.iter(printf "%7d "); printfn "")
</lang>
{{out}}
<pre>
91 259 451 481 703 1729 2821 2981 3367 4141
4187 5461 6533 6541 6601 7471 7777 8149 8401 8911
10001 11111 12403 13981 14701 14911 15211 15841 19201 21931
22321 24013 24661 27613 29341 34133 34441 35113 38503 41041
45527 46657 48433 50851 50881 52633 54913 57181 63139 63973
65311 66991 67861 68101 75361 79003 82513 83119 94139 95161
97273 97681 100001 101101 101491 102173 108691 113201 115627 115921
</pre>
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}