login
Search: a072124 -id:a072124
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n)-th factorial is the smallest factorial containing exactly n 3's, or 0 if no such number exists.
+10
9
8, 15, 25, 36, 24, 49, 32, 54, 43, 69, 76, 89, 84, 113, 82, 105, 112, 92, 114, 106, 118, 107, 109, 151, 166, 143, 160, 149, 190, 152, 158, 172, 176, 0, 192, 181, 183, 177, 180, 202, 200, 193, 226, 238, 242, 223, 251, 227, 290, 261, 267, 292, 265, 300, 295, 285
OFFSET
1,1
COMMENTS
It is conjectured that a(34)=0 since no factorial < 10000 contained just 34 threes.
The 500-term b-file contains 16 zeros, each relying on the same conjecture, i.e., that because there is no factorial < 10000! containing just n threes no factorial satisfies the condition. - Harvey P. Dale, Jan 02 2021
LINKS
EXAMPLE
a(2)=15 since the 15th factorial, i.e., 15!=1307674368000, contains exactly two 3's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 3] != n, k++ ]; Print[k], {n, 1, 60}]
With[{fc=Range[400]!}, Table[Position[fc, _?(DigitCount[#, 10, 3]==n&), 1, 1]/.{}->0, {n, 60}]]//Flatten (* Harvey P. Dale, Jan 02 2021 *)
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
a(n) is the smallest integer k whose factorial contains exactly n 7's, or 0 if no such number exists.
+10
9
6, 14, 18, 31, 49, 22, 54, 48, 56, 71, 82, 72, 86, 81, 92, 97, 87, 122, 91, 119, 131, 112, 121, 140, 104, 152, 144, 173, 127, 157, 172, 201, 227, 179, 200, 187, 183, 210, 236, 221, 193, 217, 279, 212, 213, 235, 238, 289, 265, 228, 256, 261, 250, 242, 285, 307
OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..148
Michael S. Branicky, Table of n, a(n) for n = 0..1000 with presumed 0 values listed (search bound 93000)
EXAMPLE
a(2) = 14 since the 14th factorial, i.e., 14! = 87178291200, contains exactly two 7's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 7] != n, k++ ]; Print[k], {n, 1, 60}]
PROG
(Python)
def a(n, bound=10**4):
k = f = 1
while not str(f).count('7') == n and k <= bound: k += 1; f *= k
return k * (k <= bound)
print([a(n) for n in range(1, 149)]) # Michael S. Branicky, Jun 14 2021
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
a(n)-th factorial is the smallest factorial containing exactly n 9's, or 0 if no such number exists.
+10
9
12, 11, 21, 29, 34, 46, 36, 59, 79, 75, 0, 70, 82, 90, 95, 97, 112, 89, 105, 96, 134, 130, 127, 165, 142, 149, 144, 145, 161, 163, 182, 189, 160, 178, 139, 180, 206, 192, 224, 214, 188, 215, 226, 207, 218, 267, 283, 261, 268, 262, 240, 280, 234, 285, 343, 277, 284, 269, 281, 331, 278, 308
OFFSET
1,1
COMMENTS
It is conjectured that a(11) = 0 since no factorial < 10000 contains exactly eleven nines.
LINKS
Robert Israel, Table of n, a(n) for n = 1 .. 1000 (entries of 0 are conjectured)
EXAMPLE
a(2) = 11 since 11! = 39916800 contains exactly two 9's.
MAPLE
f:= n -> numboccur(9, convert(n, base, 10)):
V:= Vector(100):
q:= 1:
for i from 2 to 2000 do
q:= i*q; v:= f(q);
if v > 0 and v < 100 and V[v] = 0 then V[v]:= i; fi
od:
convert(V, list); # Robert Israel, Sep 29 2024
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 9] != n, k++ ]; Print[k], {n, 1, 60}]
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 *)
PROG
(Python)
def a(n, multiple_limit=300):
fk, limit = 1, multiple_limit*n
for k in range(1, limit+1):
fk *= k
if str(fk).count("9") == n: return k
return 0
print([a(n) for n in range(1, 57)]) # Michael S. Branicky, Dec 11 2021
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
More terms from Robert Israel, Sep 29 2024
STATUS
approved
a(n)-th factorial is the smallest factorial containing exactly n 2's, or 0 if no such number exists.
+10
8
2, 14, 13, 30, 40, 47, 31, 46, 54, 49, 65, 76, 62, 69, 107, 78, 86, 115, 95, 121, 109, 165, 110, 113, 149, 151, 146, 137, 162, 159, 170, 191, 195, 174, 190, 196, 164, 209, 202, 173, 198, 248, 201, 262, 231, 205, 263, 233, 246, 256, 270, 244, 287, 200, 271, 250
OFFSET
1,1
EXAMPLE
a(2)=14 since 14th factorial, i.e., 14!=87178291200, contains exactly two 2's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 2] != n, k++ ]; Print[k], {n, 1, 60}]
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
a(n)-th factorial is the smallest factorial containing exactly n 4's, or 0 if no such number exists.
+10
8
4, 19, 21, 24, 44, 42, 50, 57, 0, 60, 76, 91, 56, 86, 85, 66, 92, 88, 114, 129, 131, 106, 130, 122, 117, 157, 134, 175, 119, 150, 181, 165, 185, 179, 198, 182, 220, 228, 188, 190, 261, 235, 222, 231, 229, 233, 224, 227, 288, 372, 241, 279, 254, 253, 318, 267
OFFSET
1,1
COMMENTS
It is conjectured that a(9) = 0 since no factorial < 10000 contained just 9 fours.
EXAMPLE
a(2) = 19 since 19th factorial, i.e., 19! = 121645100408832000 contains exactly two 4's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 4] != n, k++ ]; Print[k], {n, 1, 60}]
PROG
(Python)
from math import factorial
def a(n, limit=1000):
fact = 1
for t in range(limit+1):
if str(fact).count('4') == n: return t
fact *= (t+1)
return 0
print([a(n) for n in range(1, 57)]) # Michael S. Branicky, Apr 19 2021
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
a(n)-th factorial is the smallest factorial containing exactly n 5's, or 0 if no such number exists.
+10
8
7, 17, 25, 30, 37, 41, 43, 46, 75, 65, 55, 83, 74, 80, 94, 116, 91, 114, 131, 111, 115, 136, 147, 125, 128, 143, 102, 169, 152, 157, 197, 150, 165, 185, 193, 190, 206, 198, 192, 214, 236, 203, 242, 226, 205, 256, 251, 220, 270, 239, 230, 261, 286, 222, 264
OFFSET
1,1
EXAMPLE
a(2)=17 since 17th factorial, i.e., 17!=355687428096000 contains exactly two 5's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 5] != n, k++ ]; Print[k], {n, 1, 60}]
With[{fs=Table[{n, n!}, {n, 500}]}, Table[SelectFirst[fs, DigitCount[#[[2]], 10, 5] == k&], {k, 100}]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 16 2018 *)
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
a(n)-th factorial is the smallest factorial containing exactly n 6's, or 0 if no such number exists.
+10
8
3, 15, 23, 26, 32, 41, 35, 45, 50, 72, 63, 83, 84, 98, 89, 94, 91, 121, 99, 142, 117, 160, 129, 0, 127, 131, 132, 154, 153, 163, 170, 179, 190, 178, 166, 189, 217, 209, 206, 174, 208, 199, 207, 211, 214, 245, 263, 175, 240, 255, 295, 234, 213, 296, 286, 266, 278
OFFSET
1,1
COMMENTS
It is conjectured that a(24)=0 since no factorial < 10000 contained just 24 sixes.
EXAMPLE
a(2)=15 since the 15th factorial, i.e., 15!=1307674368000, contains exactly two 6's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 6] != n, k++ ]; Print[k], {n, 1, 60}]
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
a(n)-th factorial is the smallest factorial containing exactly n 8's, or 0 if no such number exists.
+10
8
11, 9, 36, 16, 30, 27, 39, 33, 44, 58, 56, 64, 80, 70, 72, 94, 97, 71, 108, 143, 120, 134, 118, 162, 125, 133, 151, 137, 138, 159, 169, 197, 184, 171, 178, 176, 206, 177, 191, 208, 207, 240, 252, 232, 239, 270, 229, 308, 243, 223, 278, 257, 250, 0, 303, 242, 311
OFFSET
1,1
COMMENTS
It is conjectured that a(54)=0 since no factorial < 10000 contained just 54 eights.
EXAMPLE
a(2)=9 since 9th factorial i.e. 9!=362880 contains exactly two 8's.
MATHEMATICA
Do[k = 1; While[ Count[IntegerDigits[k! ], 8] != n, k++ ]; Print[k], {n, 1, 60}]
Transpose[Flatten[Table[Select[Table[{n, DigitCount[n!, 10, 8]}, {n, 500}], Last[#] == i&, 1], {i, 50}], 1]][[1]] (* Harvey P. Dale, Sep 13 2013 *)
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2002
STATUS
approved
Smallest factorial containing exactly n 1's.
+10
2
1, 87178291200, 121645100408832000, 15511210043330985984000000, 263130836933693530167218012160000000, 815915283247897734345611269596115894272000000000
OFFSET
1,2
LINKS
FORMULA
a(n) = A000142(A072124(n)). - Amiram Eldar, Sep 01 2020
EXAMPLE
a(2) = 87178291200 since 87178291200 is the smallest factorial containing exactly two 1's.
MATHEMATICA
With[{fctrs=Range[100]!}, Table[First[Select[fctrs, DigitCount[#, 10, 1] == n&]], {n, 10}]] (* Harvey P. Dale, Sep 29 2011 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 30 2002
STATUS
approved

Search completed in 0.007 seconds