I found on the Internet a question which I did not understand:
There is a -digit number with distinct factors. What is the number?
I searched and found that
Number of factors of a number of the form is .
But I did not understand how one can answer this question.
Also, if there is some way, I would be glad to know
The general formula of -digit number with number of factors?
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Hey Vinayak, here is an explanation of the formula for the number of factors: Let n=p1m1⋅p2m2⋯. Every factor of n is a product of the prime numbers risen to some power: f=p1n1⋅p2n2⋯ with 0≤n1≤m1,0≤n2≤m2.... For example let n=12=22⋅31. All the factors of 12 are:
20⋅30=1
21⋅30=2
22⋅30=4
20⋅31=3
21⋅31=6
22⋅31=12
As you can see, for each power of the prime numer pn there are mn+1 choices 0,1,...mn. Therefore, the number of factors is (m1+1)⋅(m2+1)⋯. I hope this helps!
Log in to reply
Thanks @Finnley Paolella ! Now can you please tell me how to find the general formula of n-digit number with m number of factors?
Log in to reply
I don't know if there is a general formula, but my strategy would be the following: try to factor m to find the power of prime numbers. For example: 28=4×7. A number of the form n=p13×p26 will always have 28 factors. And then we can try:
23×36=5832 is too small
23×56=125000
And that is a solution to the original question!
However, the solution is not unique. Here is another solution:
26×111×4431=311872
Number of factors: (6+1)×(1+1)×(1+1)=28
Interestingly, although there are 3,013 six-digit numbers with 28 factors, there are some numbers of factors for which there is only one six-digit number with that many factors. These are, I believe, 7, 13, 19, 38, each of which has only one six-digit number with that many factors. (edit: there are probably a lot more solo numbers of factors >50 but I aggregated everything with 50 or more factors to save on processor time.)
Log in to reply
How did you calculate this?
Log in to reply
Slightly educated brute force. I wrote a bit of simple code that worked out how many (distinct) factors a number had, looped it from 100,000 to 999,999, let it churn for a couple of hours and graphed the results.
Log in to reply
Hey Stef, that is amazing! Great visualisation :)
Log in to reply
Thanks.
Really awesome stuff! Interestingly you can also see that prime number of factors such as 7 and 11 are very less, fantastic!
Log in to reply
Yeah. I'm a big fan of visualising data. You can see all the primes (two factors), all the squares (odd number of distinct factors), and a bit of the long tail of large numbers of factors (it was long tail before I cut it off).
Log in to reply
Log in to reply
Log in to reply
Log in to reply
Maybe it's the way my brain works, maybe it's the way that Lua works but, if I don't need to share or integrate with anything else, Lua has become my go-to.
(edit) You know that moment when you've spent an hour debugging a bit of code only to realise that the language didn't work the way you expected it to...? I get that with C, JavaScript, Python and Swift. I don't get it with Lua.
Log in to reply
Log in to reply
Log in to reply
Log in to reply
Log in to reply
So, despite my liking for Lua, I'd recommend learning Python. 🙃
Log in to reply
Can you help me? I wrote a C++ program, but the numbers are too big. I heard in python there are no limits :) I'm not familiar in python programming. I can solve it with hours of programming(vectors, save to txt, read from txt etc.), but I think you can help me.
Log in to reply
The program isn't complete. As you can see this works with only 2,3,5 and 7. I need to add other primes. This is the problem.
And the garbage collector is made of gold. :) In truth, I hear a lot of good things about Python but never really liked it much myself. Much of what I do these days most of what I do is in Lua, which has 64-bit numbers. If I need an integer bigger than that then I either look to see if I can simplify the problem or pull out my clunky-and-in-need-of-a-rewrite library that stores integers as strings and has functions that can add, subtract etc.
There are libraries that handle big numbers. You should be able to find one (or many) for C++. Or, if you go down the route of writing your own solution, that's quite rewarding, too.
(I just had a glance at the problem and don't see where big numbers come into it. Did you link the right problem? Or have I missed something?) (edit: looked at your output. OK... those numbers are bigger than I would have expected).
A factor f of a number n=p1m1⋅p2m2⋅p3m3… must be a number with prime exponents which are less than or equal to the exponents of the number. To make things simple, here is an example: 60=22⋅31⋅51. Without Brute-forcing, we can think logically here. If a factor f can be represented here, say 15 which is equal to 31⋅51, the factor's prime exponents will be less than or equal to the prime exponents of n. In this case, they are equal
Taking this a step further, for each prime exponent say m1, there will be m1+1 options to choose for a power. For the number 60 and specifically prime power of 2, we have 2m1,m1∈{0,1,2} so there are 3 options.
Similarly each of the mith exponent will have mi+1 options.
The total options will thus equal the product of all =(m1+1)⋅(m2+1)⋅(m2+1)…
Log in to reply
Thanks @Mahdi Raza! Also, as @Finnley Paolella stated, the answer to the question can be 125000, can there be a general formula of that also?
Log in to reply
I don't think there is a closed-from general formula. It also depends on the base we choose, a number in base 2 will have more digits than a number in base 10. As I said in my comment, the general strategie will be the following:
factor m
try out different possibilites
Log in to reply
Log in to reply
Log in to reply
65536?
Is itLog in to reply
Log in to reply
216
That was easy..Log in to reply
Log in to reply
Log in to reply
I think it's possible that I don't understand the question. (edit: Narrator: "He didn't understand the question.")
The lowest composite number I can generate with 2 distinct factors is 2×3=6(=3!)
The lowest composite number I can generate with 3 distinct factors is 2×3×4=24(=4!)
...
The lowest composite number I can generate with n distinct factors is (n+1)!
...
The lowest composite number I can generate with 28 distinct factors is 29!=8841761993739701954543616000000. This has a lot more than 6 digits. What is it that I don't understand here?
(Additional, just for laughs, if I insist that the 28 factors are prime factors, I get: 2566376117594999414479597815340071648394470.)
Log in to reply
@Stef Smith, Sir, I did not understand what you mean. Please elaborate!
Log in to reply
A misunderstading of how factors work. Some days my brain doesn't work so well. :)
Log in to reply
Hey Stef, The number 24 has more than 3 factors. It has 8 factors: 1, 2, 3, 4, 6, 8, 12, 24. Therefore, applying the factorial function does not work because 29! factorial has way more factors than 29.
I hope this helps :)
Log in to reply
Ah... I understand. Thanks.
Log in to reply
Log in to reply
@Finnley Paolella) that there are too many such numbers!
I now think(thanks to125000?
Log in to reply
Yes, it is one of the answers I know of now, but as Finnley Paolella stated, it is not unique.
@David Vreken, @Pi Han Goh, @Mahdi Raza, @Páll Márton, @Chew-Seong Cheong, @Vikram Karki, @Hamza Anushath, @Alak Bhattacharya, @Stef Smith, @Ram Mohith, @jordi curto, @Finnley Paolella, @Zakir Husain, @Maria Paszkiewicz, @João Pedro Afonso, @Alice Smith , @Hana Wehbi , @Richard Desper , @Yajat Shamji @Marvin Kalngan
@Vinayak Srivastava
Great Question, But yes has way too many solutions.
@Vinayak Srivastava,if product of factors are given,then a unique solution can be determined.
Log in to reply
Seems interesting! Please elaborate!
Log in to reply
read it
Log in to reply
@Vinayak Srivastava,have you read it:-)
Log in to reply
Log in to reply
Log in to reply
Log in to reply
Task: Find the least number
n
that can we represented as a productn = a ∙ b
ink (1 ≤ k ≤ 50)
ways. Productsa ∙ b
andb ∙ a
are the same, all numbers are positive integers.The result is: