Factorial primes: Difference between revisions

m (FreeBASIC moved to the BASIC section.)
Line 966:
 
=={{header|Racket}}==
{{incorrect|Racket|"As 0! (by convention) and 1! are both 1, ignore the former and start counting from 1!", (not 2!).}}
 
<syntaxhighlight lang="racket">
#lang racket
Line 977 ⟶ 975:
(stream-cons `(+ ,n ,(add1 curr-fact))
(factorial-stream-iter (add1 n) (* curr-fact (+ n 1))))))
(factorial-stream-iter 21 21))
 
(define (format-large-number n)
Line 1,010 ⟶ 1,008:
 
<pre>
1: 21! + 1 = 32
2: 32! -+ 1 = 53
3: 3! +- 1 = 75
4: 43! -+ 1 = 237
5: 64! - 1 = 71923
6: 76! - 1 = 5039719
7: 117! +- 1 = 399168015039
8: 1211! -+ 1 = 47900159939916801
9: 1412! - 1 = 87178291199479001599
10: 2714! +- 1 = 1088886945041835216076800000187178291199
11: 3027! -+ 1 = 26525285981219105863630847999999910888869450418352160768000001
12: 3230! - 1 = 263130836933693530167218012159999999265252859812191058636308479999999
13: 3332! - 1 = 8683317618811886495518194401279999999263130836933693530167218012159999999
14: 33! - 1 = 8683317618811886495518194401279999999
14: 37! + 1 = 1376375309122634504...9581580902400000001 (total 44 digits)
15: 3837! -+ 1 = 52302261746660111171376375309122634504...41000742911999999999581580902400000001 (total 4544 digits)
16: 4138! +- 1 = 33452526613163807105230226174666011117...07516651520000000014100074291199999999 (total 5045 digits)
17: 7341! + 1 = 44701154615126843403345252661316380710...36800000000000000010751665152000000001 (total 10650 digits)
18: 7773! + 1 = 14518309202828586964470115461512684340...80000000000000000013680000000000000001 (total 114106 digits)
19: 9477! -+ 1 = 10873661566567430801451830920282858696...99999999999999999998000000000000000001 (total 147114 digits)
20: 11694! +- 1 = 33931086844518982011087366156656743080...00000000000000000019999999999999999999 (total 191147 digits)
21: 154116! + 1 = 30897696138473508873393108684451898201...0000000000000000001 (total 272191 digits)
22: 166154! -+ 1 = 90036917057784373663089769613847350887...99999999999999999990000000000000000001 (total 298272 digits)
23: 320166! +- 1 = 21161033472192524829003691705778437366...00000000000000000019999999999999999999 (total 665298 digits)
24: 324320! -+ 1 = 22889974601791023212116103347219252482...99999999999999999990000000000000000001 (total 675665 digits)
25: 340324! +- 1 = 51008644721037110802288997460179102321...00000000000000000019999999999999999999 (total 715675 digits)
26: 379340! -+ 1 = 24840307460964707055100864472103711080...99999999999999999990000000000000000001 (total 815715 digits)
27: 399379! +- 1 = 16008630711655973812484030746096470705...00000000000000000019999999999999999999 (total 867815 digits)
28: 427399! + 1 = 29063471769607348411600863071165597381...0000000000000000001 (total 940867 digits)
29: 469427! -+ 1 = 67718096668149510902906347176960734841...99999999999999999990000000000000000001 (total 1051940 digits)
30: 546469! - 1 = 14130200926141832546771809666814951090...9999999999999999999 (total 12601051 digits)
cpu time: 2440 real time: 2440 gc time: 3</pre>
 
8

edits