OFFSET
1,2
COMMENTS
Record high values are m = 0, 2, 9, 14, 96, 113, 205, 245, 351, 369, 597, ... (see A279089); these occur, respectively, at n = 1, 2, 3, 8, 9, 22, 27, 34, 43, 45, 58, ... (see A279090). - Jon E. Schoenfield, Jan 30 2017
The existence of such m for each n was proven by Maxfield in 1970. The first 999 terms of this sequence were calculated by Southard in 1983. - Amiram Eldar, Dec 18 2018
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..10000 (terms 1..1000 from David W. Wilson).
John E. Maxfield, A Note on N!, Mathematics Magazine, Vol. 43. No. 2 (1970), pp. 64-67.
Laura Southard, Investigations on Maxfield's Theorem, Pi Mu Epsilon Journal, Vol. 7, No. 8 (1983), pp. 493-495, alternative link.
EXAMPLE
Since no factorial below 96! ~ 9.91*10^149 starts with 9, we have a(9) = 96. Similarly, 16 first appears as the leading digits of 89! ~ 1.65*10^136 and hence a(16) = 89. - Lekraj Beedassy, Oct 31 2010 and Robert G. Wilson v, Nov 05 2010
MATHEMATICA
f[n_] := Block[{k = 0, m}, While[ m = Max[0, Floor@ Log[10, k! ] - Floor@ Log[10, n]]; (k! - Mod[k!, 10^m])/10^m != n, k++ ]; k]; Array[f, 67] (* Robert G. Wilson v, Nov 05 2010 *)
PROG
(PARI) A018799(n)={ local( F=1, k=0 ); while( F\1!=n, F*=k++; while( F>=n+1, F/=10)); k} \\ M. F. Hasler, Feb 01 2009
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved