Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #27 Jan 01 2025 14:40:13
%S 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,
%T 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,
%U 18,8,3,1,57,27,12,5,2,1,43,20,9,4,2,72,33,15,7,3,1
%N The most significant digit in base n representation of n!.
%C a(n) < n, by definition.
%C Numbers n such that a(n)=1: 2, 4, 8, 12, 16, 20, 25, 29, 34, 39, 44, 49, 55, 60, 65, 71, 82, 88, 94, 105, 111, 117, 123, 136, ... (see A221707).
%C Numbers n such that a(n) > a(k) for k < n: 2, 3, 5, 9, 13, 17, 21, 30, 40, 45, 50, 66, 77, 100, 118, 124, 130, 155, 161, 226, 246, 273, 371, 378, 385, 421, 450, 472, 509, 584, 599, 637, 660, 683, 745, 784, 855, 983, 991, 999, ... (see A221708).
%H Alois P. Heinz, <a href="/A216377/b216377.txt">Table of n, a(n) for n = 2..10000</a>
%F 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.
%p a:= n-> iquo(n!, n^ilog[n](n!)):
%p seq(a(n), n=2..100); # _Alois P. Heinz_, Sep 06 2012
%t Table[IntegerDigits[n!, n][[1]], {n, 2, 100}] (* _T. D. Noe_, Sep 06 2012 *)
%o (Python)
%o import math
%o def modlg(a,b):
%o return a // b**int(math.log(a,b))
%o for n in range(2,88):
%o print(modlg(math.factorial(n), n), end=', ')
%Y Cf. A216021, A215894, A221707, A221708.
%Y Cf. also to scatter plots of A265891 and A265894.
%K nonn,base,look
%O 2,2
%A _Alex Ratushnyak_, Sep 06 2012