Number Of Prime factor (N.O.P.) Week 1

First week of Number of Prime factor (N.O.P.) will be started from 26 July, 2020 .

But before that some important things to be mentioned for those who will be participating :

  • The task of each participant will be announced through a new notice on the day itself (i.e. 26 July, 2020)

  • Each and every participant kindly try to submit the input and the output both before the end of the week (i.e 2 August, 2020)

  • The program will be there on that notice itself with the value of variable k,lk,l and mm separately for each participants. It will be shown on a table like this one below :

NAMEValue of kkValue of llValue of mm
XYZ123123123
XYZ123123123
XYZ123123123
  • All participants can send their results on any day throughout the week.

  • Any one can join for this week till coming Sunday. After that names of participants for the next week will be registered.

Note :

  • Special request to Páll Márton to share the code (input) of this

  • Any suggestion can be made here.

  • If you have any doubt related to this then clear it here quickly!

  • Name of participants for week 1 is given below in the comments.

  • If you want to participate then give your name in the comments

  • See On Most common number of prime factor! for more information

Note by Zakir Husain
11 months ago

No vote yet
1 vote

  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:

  • 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.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Log in to reply

Sir, please remove my name. I have even downloaded the software, but I got a lot of assignments from school in this week. Maybe the online test will also be held soon. So, I need to complete my backlog, otherwise I will be left behind. Sorry that I could not participate, but I will help if you mention me for some small things, which won't take much time.

Vinayak Srivastava - 11 months ago

Log in to reply

Ok, I'll try to give you small ranges so that the task of yours can be completed faster. It will take less than 5 minutes. If still wanted to remove then you can ask for it again.

Zakir Husain - 11 months ago

Log in to reply

@Zakir Husain Is there any specific time, or I can do it anytime when I open my device?

Vinayak Srivastava - 11 months ago

Also you have the whole week for the task you can do it whenever you want

Zakir Husain - 11 months ago

Log in to reply

@Zakir Husain Oh, then I will surely do it! Please don't remove me, then!

Vinayak Srivastava - 11 months ago

Log in to reply

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <vector>
using namespace std;
typedef long long int longint;
vector<longint> first;
vector<longint> second;
vector<longint> solution;
const longint minimum=2;
longint maximum=1000000;
int main()
{
    first.resize(maximum+1,0);
    second.resize(maximum+1,0);
    for(int a=minimum;a<=maximum;a++){
        if(second[a]==-1)   continue;
        for(int b=a;b<=maximum;b+=a){
            first[b]++;
            second[b]=(second[b]==-1)?-1:(second[b]==0)?a:(a%second[b]==0)?second[b]:-1;
        }
    }
    for(int a=minimum;a<=maximum;a++){
        if(first[a]>=solution.size()) solution.resize(first[a]+1,0);
        solution[first[a]]++;
    }
    for(int a=1;a<solution.size();a++)
        cout << solution[a] << endl;
    return 0;
}

Log in to reply

thanks!

Zakir Husain - 11 months ago

Log in to reply

@Zakir Husain You are welcome! I like the programming. If you have other interesting problems, then please share them :)

I can’t run it on mobile since I don’t want to fry the CPU :( and I don’t have access to my computer recently

Jeff Giff - 11 months ago

Log in to reply

@Jeff Giff will you have your computer till 2nd2_{nd} August,2020?

Zakir Husain - 11 months ago

Log in to reply

@Zakir Husain I guess I’ll have it in a week :)

Jeff Giff - 11 months ago

@Zakir Husain I’ll compute sizes with time less than 20 secs theoretically (as my computer would take minutes) :D

Jeff Giff - 11 months ago

@Zakir Husain BTW I think we can't use my code in intervalls. I think you should write a program, which print you the prime numbers(in my program in the second vector you can see they have only one factor),then you upload it, after than the people download it, save into a txt, and after that you should write another program which read the txt files and fills the vectors in the given intervalls like my code(if you know the prime numbers, then the second vector us unnecessary). Don't forget the powers(I don't know how to translate it, so I used the name of the c++ function) :) If you have any questions, then I will answer them, when I can. Can you write how will you solve that? I think if you upload your codes, examples etc. then more people will join.

Log in to reply

@A Former Brilliant Member I know that, I will mention the code in the notice (on 26 July) there the code will be written so that every one can copy and paste @Siddharth Chakravarty

Zakir Husain - 11 months ago

@Zakir Husain could you paste the code what you want us to run in the program, rather than we typing and looking from the image what you have posted, so that we can copy easily and there are no errors.

Siddharth Chakravarty - 11 months ago

An important announcement : Ive eliminated variable k , so in the table tomorrow variable k will not be there. The code will be provided with the variables (only l and m) and there values.\Large{An\space important\space announcement\space :\space I've\space eliminated\space variable\space ''k''\space,\space so\space in\space the\space table\space tomorrow\space variable\space k\space will\space not\space be\space there.\space The\space code\space will\space be\space provided\space with\space the\space variables\space (only\space ''l''\space and\space ''m'')\space and\space there\space values.}

Note :

What I've done is that I've wrote the variable kk in terms of variable mm, because I some how figured out that it depends on the value of m''m'', so i just removed it from the program which will be sent tomorrow, or you can ask if you want it now. But the list of the variable will not be sent today (as it is being prepared)

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

Send it now @Zakir Husain

Siddharth Chakravarty - 10 months, 3 weeks ago

Log in to reply

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from math import * 
l=#type l here (value given to you) 
m=#type m here (value given to you) 
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]=[] 
for a in range(l,m): 
    if a%(10**5)==0:print(a) 
    eval("a"+str(len(primefact(a)))+".append("+str(a)+")")

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain Use three ` symbols, give the name of the programming language, line break, code, line break, again the three symbols.

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member Didn't understood well...

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain

1
print "I don't know what"

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member Please provide the latex you wrote, not the result.

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain Only at the end of the whole code write the second three symbols

A Former Brilliant Member - 10 months, 3 weeks ago

@Zakir Husain

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from math import *
l=#type l here (value given to you)
m=#type m here (value given to you)
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]=[]
for a in range(l,m):
if a%(10**5)==0:print(a)
eval("a"+str(len(primefact(a)))+".append("+str(a)+")")

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member How you did that???

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain Python from math import * l=#type l here (value given to you) m=#type m here (value given to you) 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]=[] for a in range(l,m): if a%(10**5)==0:print(a) eval("a"+str(len(primefact(a)))+".append("+str(a)+")")

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member ``` Python
<whole code>
```

A Former Brilliant Member - 10 months, 3 weeks ago

@Zakir Husain link

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member Finally, done!!

Zakir Husain - 10 months, 3 weeks ago

@Zakir Husain It's working :) (with 2-10)

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member What did you mean by ''(with 2-10)''

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain from 2 to 10

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member What 2 to 10

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain I don't understand. It's working in the [2;10] interval

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member (Did you mean this)- You didn't understood what I am doing from line 2 to line 10 in my program???

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain No. I tested the program.

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member Wait, wait. Write what you want to say, I'm not understanding. Kindly explain

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain I pasted your program into a python file, saved, ran it with l=2 and m=10 and I got the right numbers

A Former Brilliant Member - 10 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member Ok, so you tested my program

Zakir Husain - 10 months, 3 weeks ago

Log in to reply

@Zakir Husain Yeah.

A Former Brilliant Member - 10 months, 3 weeks ago

Although I've send it here, it will be written separately in another note also (tomorrow).

Zakir Husain - 10 months, 3 weeks ago

Announcement:\Large{Announcement:} New plan is here, everything is nearly changed now

Zakir Husain - 2 months, 3 weeks ago
×

Problem Loading...

Note Loading...

Set Loading...