login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072220 a(n)-th factorial is the smallest factorial containing exactly n 9's, or 0 if no such number exists. 8

%I #12 Sep 18 2023 19:21:36

%S 12,11,21,29,34,46,36,59,79,75,0,70,82,90,95,97,112,89,105,96,134,130,

%T 127,165,142,149,144,145,161,163,182,189,160,178,139,180,206,192,224,

%U 214,188,215,226,207,218,267,283,261,268,262,240,280,234,285,343,277

%N a(n)-th factorial is the smallest factorial containing exactly n 9's, or 0 if no such number exists.

%C It is conjectured that a(11) = 0 since no factorial < 10000 contains exactly eleven nines.

%e a(2) = 11 since 11! = 39916800 contains exactly two 9's.

%t Do[k = 1; While[ Count[IntegerDigits[k! ], 9] != n, k++ ]; Print[k], {n, 1, 60}]

%t Module[{c=Table[{n,DigitCount[n!,10,9]},{n,350}]},Table[SelectFirst[c,#[[2]]==m&],{m,60}]][[;;,1]]/."NotFound"->0 (* _Harvey P. Dale_, Sep 18 2023 *)

%o (Python)

%o def a(n, multiple_limit=300):

%o fk, limit = 1, multiple_limit*n

%o for k in range(1, limit+1):

%o fk *= k

%o if str(fk).count("9") == n: return k

%o return 0

%o print([a(n) for n in range(1, 57)]) # _Michael S. Branicky_, Dec 11 2021

%Y Cf. A072232, A072208, A072204, A072200, A072199, A072178, A072177, A072163, A072124.

%K base,nonn

%O 1,1

%A _Shyam Sunder Gupta_, Jul 30 2002

%E Edited and extended by _Robert G. Wilson v_, Jul 31 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 13:42 EDT 2024. Contains 371254 sequences. (Running on oeis4.)