A216377 The most significant digit in base n representation of n!.
1, 2, 1, 4, 3, 2, 1, 6, 3, 2, 1, 7, 4, 2, 1, 10, 5, 2, 1, 15, 8, 4, 2, 1, 13, 6, 3, 1, 25, 12, 6, 3, 1, 25, 12, 6, 3, 1, 28, 13, 6, 3, 1, 33, 16, 7, 3, 1, 41, 20, 9, 4, 2, 1, 26, 12, 6, 2, 1, 38, 18, 8, 3, 1, 57, 27, 12, 5, 2, 1, 43, 20, 9, 4, 2, 72, 33, 15, 7, 3, 1
Offset: 2
Links
- Alois P. Heinz, Table of n, a(n) for n = 2..10000
Programs
-
Maple
a:= n-> iquo(n!, n^ilog[n](n!)): seq(a(n), n=2..100); # Alois P. Heinz, Sep 06 2012
-
Mathematica
Table[IntegerDigits[n!, n][[1]], {n, 2, 100}] (* T. D. Noe, Sep 06 2012 *)
-
Python
import math def modlg(a,b): return a // b**int(math.log(a,b)) for n in range(2,88): print(modlg(math.factorial(n), n), end=', ')
Formula
a(n) = modlg(n!, n), where modlg is the function defined in A215894: modlg(A,B) = floor(A / B^floor(logB(A))), logB is the logarithm base B.
Comments