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.
alteryx Community

# Weekly Challenge

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

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

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

Submit Feedback

## Challenge #187: Generate Prime Numbers

14 - Magnetar

A prime example of a good weekly challenge.

In one line of Python,

``[i for i in range(2,50) if 0 not in (i%j for j in range(2,i))]``

Otherwise,

Spoiler
Workflow

Code

5 - Atom

Here's my solution

Spoiler
7 - Meteor

This solution is very inefficient and generates a lot of waste data:

Spoiler
15 - Aurora

@elliotyoung - I used the R tool here.

12 - Quasar

No pretty, but I got there.

solution attached.

10 - Fireball

I liked this one!

Spoiler
11 - Bolide

A good old sieve. 998 iterations in ~1 min for primes under 1 000 000 all in Alteryx

Spoiler
1. Main Workflow generates the rows and feeds the iterative macro, then filter primes2. Loop through the integers that are still prime until SQRT(Target) and flag whether number is divisible (discard) or not (keep)
8 - Asteroid

Alteryx Alumni (Retired)

Think my solution may be a little too simplistic, but it gets the job done! 2 tools.

5 - Atom

Here's my solution, it is based on trial division method. For very large numbers it will be slow to generate the data required but it will work.

Spoiler