After seeing this note I made a python program to count number of prime factors of all the numbers from to and the program did it in minute. Then I tried from to but I calculated that it will take more than one day to complete the task.
Then I planned to organize an event to complete the task not alone but with other brilliant members! (so as to work faster)
Everyone who have a computer (or laptop) and have python IDLE or any IDE to write the program can participate.
What you have to do right now is the following :
Give you Brilliant username if you are interested so that I can organize everything accordingly.
Write the following program and save it till I instructs further :
The thing written in the box in the image is not important to be written now, you can assign variable and in there place, values of these variables will be different for different participants. I will talk about this later in the note.
The program will take all the natural numbers from to . And then it shall be prime factorizing each of them and counting the number of prime factor each number will be having, and then it will be forming lists where each list where will be containing all the numbers having '''' number of prime factors.
We shall be running this program jointly, every Sunday (from 26 July) I will be sharing values of for each participant. What they have to do is to put these values in the program and then they have to run it, in output they have to give the commands :
for i in range(0,k):
print(eval("len(a"+str(i)+")"))
The output that you will be getting shall be like this (just an example):
What you will be doing after this is to share the output you got here in the comments.
Every participants will get there task on Sunday and they can submit there outputs till the next Sunday comes.
Note :
There is no limit of number of participants, also you can submit your name on any date.
A request to RadMath community to add this in their ''Late Events''
If any confusion is their in your mind related to this event then clear it quickly here.
The time complexity of the program is about . If you have any better program with lesser time complexity then kindly share here.
Any suggestions can be given in the comments below.
The event will start from 26 July, 2020
Hope we will explore something interesting and new!
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
@David Stiff, @Justin Travers, @Jeff Giff, @Vinayak Srivastava, @jordi curto, @Aryan Sanghi, @Yajat Shamji, @Kumudesh Ghosh, @Alak Bhattacharya, @Marvin Kalngan, I can't do it alone we must work together
@Mahdi Raza, @Kriti Kamal, @Laurent Verweijen, @Pop Wong, @Akela Chana, @Maria Paszkiewicz, @Sahar Bano, @L Chua, @Razing Thunder, @Hamza Anushath, @Adhiraj Dutta, @Gandoff Tan, Try if anyone can help!
Ok I am ready. Will try to find a better code. :) Username same as name.
Log in to reply
Thanks! You are in. Will you also be participating for the task also? (Executing the code)
@Zakir Husain, Sir, sorry, but I am not good at coding, I only know some basic codes, so I may not be able to help. But if there is anything other than coding to be done, do tell me!
Log in to reply
@Vinayak Srivastava - No need to code, just execute the code in the image and as the instructions are given every Sunday (from 26 July) I myself will share the code. What you need to do is just execute it on your device and share the output
Log in to reply
Ok, then I'll try. Please just tell me which software I need to download.
Log in to reply
Python 3.8 here (or you may use any other IDE to run the program) and search for ''IDLE'' in your device (after download) the code will be executed there. Don't try now, I will provide instructions for for now only do this much.
Just download@Vinayak Srivastava - I will suggest you this video if you are new to ''IDLE''
Log in to reply
Zakir I don't know much about codes. But i can run it on IDLE. Count me in. User name Akela.
Log in to reply
@Akela Chana - Added your name
Log in to reply
''C'' have a limit in int type, this program will work till 2,147,483,647 but after going that far it may not work. What I will be doing is that we want more and more numbers. After going till 109 I'm planning to try till 1012 and after that 1015 and so on (not alone but together). But thanks for the idea I will try on my device. Kindly mention this discussion in RedMaths
Log in to reply
Ok:)
But can you program this into Python version?
Log in to reply
Log in to reply
Log in to reply
Log in to reply
a,b where the sum of the integer factors of a excluding a add up to b, and also the other way round)?
Hmmm... what about Twin numbers(two integersIt has nn time complexity. You could use Sieve Of Erasthoneses to find prime factors till n in nloglogn time complexity.
Log in to reply
Oic :)
Wait... this is an improved version! The prime need only be less thannumber instead of the number itself.
So I tested every prime less than the square root of the number, so for a number n, the time complexity would be rate that a positive integer is prime×n.
Log in to reply
≈nn
But still it will beLog in to reply
Log in to reply
Nice method! But how will you arrange the data coming out, it will be a very huge data.
Log in to reply
It is arranged from smallest to largest :)
@Jeff Giff - I've added your name as a participant too
I'm in. Username same as name.
Love the code by the way! I almost got it all, but I would love a more detailed explanation of how it works!
Not sure if generating a list of primes ahead of time has already been mentioned. Not sure if it would save time either.
I've never heard of the global() function, but I've always wanted to be able to generate variables with incrementing names. Thanks!
And thanks for taking such an interest in this. I didn't imagine the problem would be split up and solved communally! :)
Log in to reply
@David Stiff - Added your name
List of participants (for clarification to all, a new note having all the information is coming soon!) :
@Aryan Sanghi
@Vinayak Srivastava
@Jeff Giff
@Akela Chana
@David Stiff
@Siddharth Chakravarty
I am ready to co-operate! 🙂
Log in to reply
Thanks! Added you too.
I don't know much about python, but I made a c++ code. There are limits, but I got the result for 106 in 0.358 seconds. Maybe your code is bad or your processor is old. I use AMD A4-4020 with Radeon(tm) HD Graphics 3.20 GHz. The result for 106:
But your code says 864
I can say the results only until 108, from 109 the vectors size is too big, so the system can't use them :( The result for 108 in 39.567 seconds:
Log in to reply
Now I added to my code an auto sizer to get the result without zeros :)
BTW how can you connect computers to calculate this?
Log in to reply
I believe the idea is to have multiple people calculate small intervals on their own, and then the results will be summed together.
Hi Pall. Would you mind sharing your code? I'd be very interested in knowing how you did this in less than half a second! I don't know C++, but I could probably determine the basic idea behind it. Thanks!
Log in to reply
Log in to reply
can you provide the code you used?
New note : NumberOfPrimefactor(N.O.P.)Week1
Announcement: New plan is here, everything is nearly changed now