login
Numbers n > 1 such that log_10(n!) is closer to an integer than at any smaller n.
4

%I #60 Mar 14 2015 15:00:35

%S 2,3,5,14,22,27,35,95,96,197,261,5935,7399,8998,11671,17411,108965,

%T 165535,258335,549545,1542194,2064173,4146167,4594140,5814278,9242360,

%U 21603225,28563732,40700787,54528830,252544447,1430841730,5042264463,11012237562,31774693500

%N Numbers n > 1 such that log_10(n!) is closer to an integer than at any smaller n.

%C If the Kamenetsky formula (see A034886) for the number of digits in n! ever fails, it will be at some number in this sequence where log_10(n!) and log_10(2*Pi*n)/2 + n*(log_10(n/e)) are on opposite sides of an integer. For n > 1, log_10(n!) cannot be an integer, otherwise n! = 10^m for some m, which is not possible because n! has all the primes up to n as factors, but 10^m has only two prime factors: 2 and 5.

%C The above comment is mostly correct. As it turns out, the smallest counterexample to Kamenetsky's formula, 6561101970383, does, in fact, belong to this sequence. However, there should exist an infinite number of such counterexamples [see the Elkies link], and while most of them should belong to this sequence, a small percentage should not, because of the presence of some smaller number n at which log_10(n!) is even closer (whether on the high or low side) to its nearest integer (see Example section). As N increases, the number of terms below N in this sequence should approach log(N), and the number of counterexamples to Kamenetsky's formula should approach log_10(N)/12; e.g., if we could search through all integers up to N=10^1200, we should expect to find roughly log(10^1200) ~ 2763 terms in this sequence, and roughly 100 failures of Kamenetsky's formula, a few of which should not be in this sequence. - _Jon E. Schoenfield_, Dec 02 2014

%H Jon E. Schoenfield, <a href="/A177901/b177901.txt">Table of n, a(n) for n = 1..40</a>

%H Noam D. Elkies, <a href="http://mathoverflow.net/questions/19170">A counterexample to Kamenetsky's formula for the number of digits in n-factorial</a>

%e From _Jon E. Schoenfield_, Dec 02 2014: (Start)

%e This sequence contains a subset of each of two related sequences: A249829 and A250022 (values of n at which the fractional part of log_10(n!) reaches a record high or a record low, respectively). To see how they interrelate, consider the following four integers (two from each of those sequences):

%e +------------------------+-----------------------+

%e | log_10(n!) | Member of sequence |

%e +----------+-------------+-------+-------+-------+

%e n | near int | difference |A249829|A250022|A177901|

%e =======+==========+=============+=======+=======+=======+

%e 1542194| 8873548 | +0.00000133 | yes | no | yes |

%e 1692693| 9807947 | -0.00000158 | no | yes | no |

%e 2064173| 12138273 | -0.00000030 | no | yes | yes |

%e 2159448| 12740851 | +0.00000052 | yes | no | no |

%e =======+==========+=============+=======+=======+=======+

%e .

%e At n=1542194, log_10(n!) = 8873548.00000133 differs from its nearest integer by only 0.00000133; this absolute difference is less than that at any smaller value of n, so 1542194 is in this sequence.

%e At n=1692693, log_10(n!) = 9807946.99999842 differs from its nearest integer by only 0.00000158; although the fractional part reaches a record high, this absolute difference is greater than that at n=1542194, so 1692693 is not in this sequence.

%e At n=2064173, log_10(n!) = 12138272.99999970 differs from its nearest integer by only 0.00000030; this absolute difference is less than that at any smaller value of n, so 2064173 is in this sequence.

%e At n=2159448, log_10(n!) = 12740851.00000052 differs from its nearest integer by only 0.00000052; although the fractional part reaches a record low, this absolute difference is greater than that at n=2064173, so 2159448 is not in this sequence.

%e (End)

%t mx=1; s=0; Reap[Do[s=s+N[Log[10,n], 30]; d=Abs[Round[s]-s]; If[d<mx, mx=d; Sow[n]], {n,2,10000}]][[2,1]]

%Y Cf. A249829, A250022.

%K nonn

%O 1,1

%A _T. D. Noe_, Dec 15 2010

%E a(31)-a(35) from _Jon E. Schoenfield_, Nov 11 2014