login
a(n)-th factorial is the smallest factorial containing exactly n 1's, or 0 if no such number exists.
10

%I #17 Sep 01 2020 08:55:03

%S 1,14,19,25,32,40,33,60,63,47,68,64,74,87,79,73,97,110,107,132,134,

%T 129,116,136,123,113,145,143,160,180,153,171,185,176,224,209,196,207,

%U 229,221,211,167,236,252,260,201,235,274,249,231,246,284,199,273,294,267

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

%C By checking the factorials of all the numbers below 10^6, it is conjectured that up to 10^4 there are 746 values of n for which a(n) = 0: n = 84, 164, 167, 169, 182, ... (see the link for more values). - _Amiram Eldar_, Sep 01 2020

%H Amiram Eldar, <a href="/A072124/b072124.txt">Table of n, a(n) for n = 1..83</a>

%H Amiram Eldar, <a href="/A072124/a072124.txt">Table of n, a(n) for n=1..10000 with 746 conjectured values</a>

%e a(2) = 14 since the 14th factorial, i.e., 14! = 87178291200, contains exactly two 1's.

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

%t Module[{f=Table[{n,DigitCount[n!,10,1]},{n,500}]},Table[SelectFirst[ f,#[[2]] == k&],{k,60}]][[All,1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Apr 27 2019 *)

%Y Cf. A000142, A072295, A072220, A072208, A072204, A072200, A072199, A072178, A072177, A072163.

%K base,nonn

%O 1,2

%A _Shyam Sunder Gupta_, Jul 30 2002

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