login
a(n) is the smallest m such that m! > exp(n*m); or where the mean of the logs of the first m integers exceeds n.
2

%I #23 Jul 14 2019 22:18:04

%S 2,6,18,52,145,400,1093,2977,8098,22021,59868,162748,442406,1202597,

%T 3269009,8886102,24154944,65659960,178482291,485165185,1318815724

%N a(n) is the smallest m such that m! > exp(n*m); or where the mean of the logs of the first m integers exceeds n.

%C Rewriting the expression as log(m!)/m > n yields the interpretation: the smallest m such that the mean of the logs of the integers from 1 to m is greater than the integer n. This is also a useful way to determine a(n) for large n.

%C a(n) diverges from floor[e^(n+1)] slowly and almost linearly (to the low side) as n increases with these differences: 0, -1, -2, -2, -3, -3, -3, -3, -5, -5, -6, -6, -7, -7, -8, -8, -8, -9, -9, -10, -10.

%C The first five terms are the same as A128104(n-1).

%C From _Jon E. Schoenfield_, Dec 07 2014: (Start)

%C Let N = n+1, b = log(2*Pi)/2 - 1/4, and u = N/2 + b; then

%C a(n) = ceiling(x)

%C where x = exp(N - (u + 1/4) / e^N - (u^2 + 1/48) / e^(2*N))

%C is correct for all n in [0..10000], and probably for all nonnegative n. Rationale: let t be the real number that satisfies gamma(t+1) = exp(n*t); then the smallest integer m such that m! > exp(n*m) is ceiling(t). The above formula for x gives an approximation for t. At large values of n, x becomes huge, yet the approximation error x-t becomes extremely small, very roughly on the order of x^-2. E.g., at n=10000, x = 2.393...*10^4347, and x-t = 3.273...*10^-8676, so x agrees with t to more than 13000 significant digits. The above formula for a(n) will fail if and only if x and t fall on opposite sides of an integer, which seems extremely unlikely ever to occur. (End)

%F No exact formula found so far.

%e For n = 0, 2! > exp(0*2) = 1.

%e For n = 1, 6! = 720 > exp(1*6) = 403.

%e For n = 2, 18! = 6.402 * 10^15 > exp(2*18) = 4.311 * 10^15.

%o (PARI) a(n)=m=1;while(m!<=exp(n*m),m++);m

%o n=1;while(n<15,print1(a(n),", ");n++) \\ _Derek Orr_, Nov 13 2014

%Y Cf. A128104.

%K nonn

%O 0,1

%A _Richard R. Forberg_, Nov 12 2014