OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) is asymptotic to sqrt(2*n) and for n > 300 a(n) = ceiling(1/2 + sqrt(1+8*n)/2) (+0 or +1).
EXAMPLE
18!/Product_{i=1..7} i! = 51051 but 18!/Product_{i=1..8} i! = 2431/1920, hence a(18) = 7.
MATHEMATICA
a[n_] := Module[{k = 1}, NestWhile[#/(++k)! &, n!, IntegerQ]; k - 1]; Array[a, 100] (* Amiram Eldar, May 14 2024 *)
PROG
(PARI) a(n)=if(n<0, 0, my(s=1); while(n!%prod(i=1, s, i!) == 0, s++); s-1)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Sep 17 2002
STATUS
approved