OFFSET
0,5
COMMENTS
Seems to be slightly more than (but asymptotic to) number of nonprimes less than or equal to n.
LINKS
Danny Rorabaugh, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = floor(log_n(n!)) for n > 1.
a(n) = A060151(n) - 1 for n > 1. - Henry Bottomley, Mar 08 2001
From Danny Rorabaugh, Apr 14 2015: (Start)
a(n) = log_n(A074182(n)) for n > 1.
From Robert Israel, Apr 14 2015: (Start)
n*(1-1/log(n)) + 1 > log(n!)/log(n) > n*(1-1/log(n)) for n >= 7.
Thus a(n) is either floor(n*(1-1/log(n))) or ceiling(n*(1-1/log(n))) for n >= 7 (and in fact this is the case for n >= 3). (End)
EXAMPLE
a(7)=4 because 7! = 5040, 7^4 = 2401 but 7^5 = 16807.
a(6)=3 since 6^3.67195... = 720 = 6! and 6^3 <= 6! < 6^4, i.e., 216 <= 720 < 1296.
MATHEMATICA
ds[x_, y_] :=y!-y^x; a[n_] :=Block[{m=1, s=ds[m, n]}, While[Sign[s]!=-1&&!Greater[m, 256], m++ ]; m]; Table[a[n]-1, {n, 3, 200}]
(* or *)
Table[Count[Part[Sign[Table[Table[n!-n^j, {j, 1, 128}], {n, 1, 128}]], u], 1], {u, 1, 128}] (* Labos Elemer *)
Join[{1, 1}, Table[Floor[Log[n, n!]], {n, 2, 80}]] (* Harvey P. Dale, Sep 24 2019 *)
PROG
(Sage) [1, 1] + [floor(log(factorial(n))/log(n)) for n in range(2, 75)] # Danny Rorabaugh, Apr 14 2015
(Magma) [1, 1] cat [Floor(Log(Factorial(n))/Log(n)): n in [2..80]]; // Vincenzo Librandi, Apr 15 2015
(PARI) a(n)=if(n>3, lngamma(n+1)\log(n), 1) \\ Charles R Greathouse IV, Sep 02 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Dan Bentley (bentini(AT)yahoo.com)
EXTENSIONS
Corrected and extended by Henry Bottomley, Mar 08 2001
Edited by N. J. A. Sloane, Sep 26 2008 at the suggestion of R. J. Mathar
STATUS
approved