# Weekly Challenge

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

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

## Challenge #187: Generate Prime Numbers

Highlighted
Alteryx

A solution to last week's challenge can be found here

This week's challenge comes to us from @Shreelatha!  Create a workflow to generate all the prime numbers between 0 and 50.  For this challenge, the number 1 is not considered to be prime as it only has one positive divisor.

Highlighted
Alteryx Certified Partner
Spoiler

Here's My solution. It involves comparing all combinations of numbers between 1 and 50 so it's probably not ideal if you wanted to identify primes up to a million or something but it works.

Highlighted
Alteryx Certified Partner

Here is my solution !

Spoiler

Highlighted
11 - Bolide

My solution worked great for numbers 3+.  And when I say "great" I mean for small numbers, as this would fall into the trial division as referenced Prime number article in Wikipediam found in the text in the start file.

Spoiler

Highlighted
8 - Asteroid

This one was fun, I've never thought of doing this before.

I wonder how many rows it could take before it started to struggle...

Spoiler

I suspect people will have a much cleverer way of doing this than me. Maybe i'll also try to work out a macro approach...

Highlighted
5 - Atom

Here's my solution! Thanks for a fun challenge!

Spoiler

Highlighted
Alteryx Certified Partner

I used Fermat's primality test to identify prime numbers (test isn't absolutely reliable for very large numbers, but works fine for numbers < 341). I used 2 as a basis, so I had to check "2" separately.

Spoiler

Highlighted
Alteryx Certified Partner

Here's my solution:

Spoiler
Highlighted
10 - Fireball

Here's my solution. works quickly for primes 1 - 50.

Spoiler
Highlighted
14 - Magnetar

A nice brain break for a Monday.

Spoiler