Factorial primes: Difference between revisions
m
Undo revision 338725 by Dr-neptune (talk) Erroneously overwrote Python
Thundergnat (talk | contribs) m (Undo revision 338726 by Dr-neptune (talk) Erroneously overwrote Python) Tag: Undo |
Thundergnat (talk | contribs) m (Undo revision 338725 by Dr-neptune (talk) Erroneously overwrote Python) Tag: Undo |
||
Line 726:
=={{header|Racket}}==
<syntaxhighlight lang="racket">
#lang racket
(require
(define (factorial-boundary-stream)
Line 753 ⟶ 752:
(let ([fact (format-large-number fact)])
(displayln (format "~a! ~a 1 = ~a" n op fact)))))
(for ([i (in-stream
(stream-take
(stream-filter (λ (l) (prime? (third l))) (factorial-boundary-stream))
[n (in-naturals 1)])
(begin
(display (format "~a:\t" n))
(factorial-printer i)))
</syntaxhighlight>
Line 792 ⟶ 786:
22: 166! - 1 = 9003691705778437366...9999999999999999999 (total 298 digits)
23: 320! + 1 = 2116103347219252482...0000000000000000001 (total 665 digits)
24:
25:
26:
27:
28:
29:
</pre>
=={{header|Raku}}==
|