%I #36 Sep 08 2022 08:45:08
%S 5,8,10,13,16,20,23,24,26,27,34,36,40,47,50,59,68,79,85,93,137,143,151
%N Numbers n such that n!-1 is a semiprime.
%C The next candidate for a continuation is 154!-1, which is composite with 272 decimal digits and unknown factorization. Further known terms are 157, 229, 381, 390, 392, 400, 814, 929; factorization unknown for 154, 196, 232, 271, 307, 322, 332, 333, 334, 350, 352, 386, 389, 443, 449, ...
%C Note that the two prime factors of 24!-1 = 620448401733239439359999 = 625793187653 * 991459181683 both have 12 decimal digits.
%C There is another term with prime factors with equal number of decimal digits: 34!-1 = 10398560889846739639*28391697867333973241 (20 digits each)
%C From _Antti Karttunen_, Dec 27 2015: (Start)
%C Furthermore, both factors of 24!-1 are in binary system 40 bits long (A070939), and in factorial base representation (A007623) they both have 14 digits: <7,2,6,5,4,8,2,3,0,0,2,0,2,1> and <11,5,2,10,1,5,6,3,4,1,1,3,0,1>. That is, A007623(625793187653) = 72654823002021, but the latter number cannot be represented reliably in such a more compact form, because it already contains digits > 9.
%C Factors of 34!-1 are 64 and 65 bits long, and their factorial base representations contain both 20 digits: <4,5,9,3,1,13,11,7,9,1,0,6,1,1,6,5,3,1,0,1> and <11,13,7,10,0,12,3,4,6,11,1,8,1,4,2,2,1,2,2,1>.
%C Also the factors of 5!-1 = 119 = 7*17 are both of the same length in factorial base system: "101" and "221".
%C (End)
%C 1338, 1447, 1788, 1824, 2805, 2881, 2960, 5824 are also terms of the sequence. - _Chai Wah Wu_, Feb 28 2020
%H FactorDB, <a href="http://factordb.com/index.php?query=154%21-1">Status of 154!-1</a>.
%H Paul Leyland, <a href="http://www.leyland.vispa.com/numth/factorization/main.htm">Tables of factors of N!+1 and N!-1.</a>
%H Andrew Walker, <a href="http://web.archive.org/web/20080924091946/http://www.uow.edu.au/~ajw01/ecm/minus">Factors of n!-1 for n>=400.</a>
%t Select[Range[50], PrimeOmega[#! - 1] == 2 &] (* _Vincenzo Librandi_, Dec 28 2015 *)
%o (PARI) { fm(a,b)=local(c,d,r); for(n=a,b,r=n!-1; c=vecmin(factor(r)[,1]~); d=vecmax(factor(r)[,1]~); if(bigomega(r)==2 && isprime(c) && isprime(d), print1(n" ");))} fp(2,100)
%o (Magma) IsSemiprime:=func< n | &+[ k[2]: k in Factorization(n) ] eq 2 >; [n: n in [3..50] | IsSemiprime(Factorial(n)-1)]; // _Vincenzo Librandi_, Dec 28 2015
%Y Cf. A001358, A080802.
%Y Cf. A078778 (numbers such that n!+1 is a semiprime).
%Y Cf. also A007623, A070939, A266344.
%K nonn,more,hard
%O 1,1
%A _Jason Earls_, Jan 09 2003
%E More terms from _Hugo Pfoertner_, Apr 05 2003
%E a(23) added by _Daniel Suteu_, Mar 30 2019