frommathimport*l=#type l here (value given to you) m=#type m here (value given to you) defprimefact(x):ifx==1:return[]ifx%2==0:return[2]+primefact(x/2)ifx%3==0:return[3]+primefact(x/3)forainrange(1,int(((x+1)**0.5)/6+1)+1):ifx%(6*a-1)==0:return[6*a-1]+primefact(int(x/(6*a-1)))ifx%(6*a+1)==0:return[6*a+1]+primefact(int(x/(6*a+1)))return[x]forbinrange(0,1+int(log(m,2))):c=str(b)a="a"+cglobals()[a]=[]print("processing%")forainrange(l,m):ifa%(10**5)==0:print((a-l)/(m-l)*100)eval("a"+str(len(primefact(a)))+".append("+str(a)+")")print("processing finished. final data is below")foriinrange(0,int(log(m,2))+1):print(eval("len(a"+str(i)+")"))
Variablevalues :
Name of participant
Value of l
Value of m
Akela Chana
5×106+3×107+108
4×107+108
Siddharth Chakravarty
4×107+108
5×106+4×107+108
David Stiff
5×106+4×107+108
5×107+108
Vinayak Srivastava
8×107+108
5×106+8×107+108
Zakir Husain
5×107+108
5×106+5×107+108
Jeff Giff
5×106+5×107+108
6×107+108
Zakir Husain
6×107+108
2×108
Note :
If someone still can't complete his work then he can voluntarily ask for reduction, his work then will be transferred to me (some of it).
If any of you will complete your work before the end of the week and wanted more then you can voluntarily ask for it.
If you are having any doubts related to this then clear it here.
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:
Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.
Markdown
Appears as
*italics* or _italics_
italics
**bold** or __bold__
bold
- bulleted - list
bulleted
list
1. numbered 2. list
numbered
list
Note: you must add a full line of space before and after lists for them to show up correctly
@A Former Brilliant Member
–
You just have to run the program (you can see it in this discussion) with the values of l,m special for you (it is different for different participants)
It might take long time to run it, so if you don't have to take that much long (if your computer is just that slow), you can break it into pieces so that each piece take smaller time like this :
@Zakir Husain actually my computer is too laggy and that's why it can't work for much time and so can't evaluate time taking codes. I am just searching a code so that my computer can do the work in less time. I'll require just 3-5 days. Hope you understand. :)
@Zakir Husain, I think I am free for 5-10 minutes just now, just tell me my l and m values. I will participate at least this week. My exams are postponed till 10th, so this week I can do.
from math import *
l=8*10**7+10**8
m=5*10**6+8*10**7+10**8
def primefact(x):
if x==1:return []
if x%2==0:return [2]+primefact(x/2)
if x%3==0:return [3]+primefact(x/3)
for a in range(1,int(((x+1)**0.5)/6+1)+1):
if x %(6*a-1)==0:
return [6*a-1]+primefact(int(x/(6*a-1)))
if x %(6*a+1)==0:
return [6*a+1]+primefact(int(x/(6*a+1)))
return [x]
for b in range(0,1+int(log(m,2))):
c=str(b)
a="a"+c
globals()[a]=[]
print("processing%")
for a in range(l,m):
if a%(10**5)==0:print((a-l)/(m-l)*100)
eval("a"+str(len(primefact(a)))+".append("+str(a)+")")
print("processing finished. final data is below")
for i in range(0,int(log(m,2))+1):
print(eval("len(a"+str(i)+")"))
@Zakir Husain Sir, my online classes of FIITJEE and school have both started and my schedule is becoming very hectic because I also need to get time for self studies. Also, my laptop is unable to evaluate your code because of the reason I stated. So, can you please remove me from the participants sir? I won't be able to give the output.
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
@Yajat Shamji, will you also join?
Log in to reply
No. However I like these posts! Keep it up!
@Zakir Husain - Can I participate? If yes, please tell me what to do exactly :)
Log in to reply
Yes, Some information is given here. Will you start from today itself?
Log in to reply
@Zakir Husain
Yes I understood what we are trying to do, but how can i help?Log in to reply
l,m special for you (it is different for different participants)
You just have to run the program (you can see it in this discussion) with the values ofLog in to reply
@Zakir Husain
So what's my L M?Log in to reply
Log in to reply
@Zakir Husain
Log in to reply
python IDLE or any other software
Don't run in the coding environment of brilliant. It will not work. Use@Percy Jackson - also try to send the input with the output, it will make my work easier
@Akela Chana, @Aryan Sanghi, @Siddharth Chakravarty, @David Stiff, @Jeff Giff
Log in to reply
@Siddharth Chakravarty, @Jeff Giff, @Akela Chana
@Aryan Sanghi, @Vinayak Srivastava
Log in to reply
@Zakir Husain actually my computer is too laggy and that's why it can't work for much time and so can't evaluate time taking codes. I am just searching a code so that my computer can do the work in less time. I'll require just 3-5 days. Hope you understand. :)
Log in to reply
Ok you can, but you can also break the work in small pieces so that each part will take small amount of time.
@Zakir Husain, I think I am free for 5-10 minutes just now, just tell me my l and m values. I will participate at least this week. My exams are postponed till 10th, so this week I can do.
Log in to reply
The code took too looooooong!
Input
Output
Ran for about 10 minutes again.
@Percy Jackson , are you participating ?
Log in to reply
Maybe not, I have my exams in 2 days, sorry :)
@Zakir Husain Sir, my online classes of FIITJEE and school have both started and my schedule is becoming very hectic because I also need to get time for self studies. Also, my laptop is unable to evaluate your code because of the reason I stated. So, can you please remove me from the participants sir? I won't be able to give the output.
Log in to reply
Okay, now you are removed
Log in to reply
Log in to reply
Log in to reply
Log in to reply
Log in to reply
@Akela Chana @Jeff Giff
Log in to reply
@Zakir Husain forgive me Sir, I am not able to complete given task. I am extremely sorry. Please cancel my participation.
Log in to reply
Don't worry your work is already completed, if you want you can participate in the next week, your choice.
Sorry for being late @Zakir Husain
Here is the input:
Here is the output:
Announcement: Week 3 will be announced tomorrow morning (Indian Timing) it will go until 30 August, 2019. Sorry to all, for late announcement.
Announcement: New plan is here, everything is nearly changed now
Announcement: Week 3 can't be announced today as I'll not be free for this. If you are interested to have more work then you may ask for it.
Log in to reply
Just send me any intervals you want done @Zakir Husain. Each one takes me about 10 minutes, so they're not a big deal.
Log in to reply
Log in to reply
Log in to reply