Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #187: Generate Prime Numbers

kelly_gilbert
13 - Pulsar

Thanks for the challenge, @Shreelatha! I decided to try the Python tool this week.

 

 

Spoiler
challenge_187_workflow.PNG

kelly_gilbert_1-1572620688928.png

 

 

Spoiler
Challenge 187.PNG
elliotyoung
5 - Atom

Has anyone attempted this using the R input tool?

GHM
5 - Atom

My solution. Seems to work for other up-to numbers. First time I have generated a fairly clean solution in a relatively short time. Nice challenge!

Thorntonb
6 - Meteoroid

here is my attempt struggled to get 1 in there!

Spoiler
Thorntonb_1-1572631331558.png

 

bob_pecsi
5 - Atom

Fun one. Set mine up to find all primes from 1 - whichever value you feed it. Plug in 2019 to see if you were born in a Prime year.

aehrenwo
11 - Bolide

This was so much fun to do. Two files included (main portion and the batch macro) 

 

Spoiler
I created a macro that processed through the generated list of numbers in the source input. tested it for 50, 100 and 1000 (was slow)... not sure how large it can go before the performance would degrade completely. 

It checks divides each number by the entire list to find a count of any calculations that resulted in a whole number. if count is 0 then it gets left at the end. I had to hard code 1 and 2 to be removed from the results. 
LiD
8 - Asteroid

In order to speed up, only divisors up to FLOOR(SQRT(number)) needs to be verified whether they will lead to MOD(number, divisor) = 0.

 

Spoiler
LiD_3-1572739967475.png
SteinErikHansen
5 - Atom

Two approaches - the second one works the most efficient

 

Spoiler
challenge_187_SEH.PNG

 

jasperlch
12 - Quasar

Definitely not the most efficient way.

 

Spoiler
Capture.PNG