login
Number of decimal digits in (n!)!; A000197.
3

%I #42 Nov 27 2023 23:22:50

%S 1,1,1,3,24,199,1747,16474,168187,1859934,22228104,286078171,

%T 3949867548,58284826485,915905054360,15276520209206,269617872744249,

%U 5021159048900643,98417586560408168,2025488254833817394,43675043585825292775,984729344827900257489,23172929656443132617906

%N Number of decimal digits in (n!)!; A000197.

%H Jon E. Schoenfield, <a href="/A063979/b063979.txt">Table of n, a(n) for n = 0..448</a> (first 100 terms from Robert G. Wilson v)

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Factorial.html">Factorial</a>

%p seq(length((n)!!), n=0..19); # _Zerinvary Lajos_, Mar 10 2007

%t LogBase10Stirling[n_] := Floor[ Log[10, 2 Pi n]/2 + n*Log[10, n/E] + Log[10, 1 + 1/(12n) + 1/(288n^2) - 139/(51840n^3) - 571/(2488320n^4) + 163879/(209018880n^5) + 5246819/(75246796800n^6)]]; (* A001163/A001164; good to at least a(1000) *) LogBase10Stirling[0] = LogBase10Stirling[1] = 0; Table[1 + LogBase10Stirling[n!], {n, 0, 101}] (* _Robert G. Wilson v_, Aug 05 2015 *)

%o (PARI) \\ Using 100 digits of precision.

%o a(n)=localprec(100); my(t=n!);return(floor((t*log(t)-t+1/2*log(2*Pi*t)+1/(12*t))/log(10)+1))\\ _Robert Gerbicz_, Jul 08 2008

%o (Magma) // Using about 100 more digits of precision than needed.

%o nMax:=30; SetDefaultRealField(RealField(Ceiling(Log(10,Factorial(nMax))+100))); a:=[]; for n in [0..nMax] do a[n+1]:=1+Floor(LogGamma(Factorial(n)+1)/Log(10)); end for; a; // _Jon E. Schoenfield_, Aug 07 2015

%Y Cf. A000197, A063944, A034886.

%K base,nonn

%O 0,4

%A _Robert G. Wilson v_, Sep 05 2001

%E More terms from _Vladeta Jovovic_, Sep 06 2001

%E A correspondent reported that terms a(17) - a(19) shown here were wrong. That's not true, they are correct. The correspondent was using Python, where the default precision was not large enough to calculate these terms correctly. Thanks to _Brendan McKay_, _Max Alekseyev_ and _Robert Gerbicz_ for confirming the entries. - _N. J. A. Sloane_, Jul 08 2008

%E a(20) from _Brendan McKay_, Jul 08 2008

%E a(21)-a(22) from _Hugo Pfoertner_, Nov 25 2023