Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

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 #79: Find the Closest Prime Number

ponraj
13 - Pulsar

Here is my solution!

 

Spoiler
Prime Number - MacroPrime Number - MacroWorkflowWorkflow
JoshuaGostick
11 - Bolide

My solution :)

Spoiler
challenge_79.PNG
Karam
8 - Asteroid

Solution attached. Interesting challenge!

 

Spoiler
challenge 79.PNG
Kenda
16 - Nebula
16 - Nebula
Spoiler
This one was fun.
I didn't go with the macro route. I just made the assumption that the prime number would occur within 11 plus or minus the given number. I then add a row for each number below that set of numbers and find the ones where the module is 0 only once. Then to find the closest, I take the difference between that list and the given number and keep only the lowest difference.
Capture.PNG

P.S. the community page isn't letting me post the .yxwz file so I had to export it before attaching to this post.
TonyA
Alteryx Alumni (Retired)

Here's my solution. I'm sure I could tighten this up but even as is I'm getting results for 10 digit numbers in under 3 seconds.

hanykowska
11 - Bolide

I liked this one :)

RolandSchubert
16 - Nebula
16 - Nebula

My solution

KMiller
8 - Asteroid

Solution attached. One macro for higher numbers and one for lower.

Spoiler
18-06-2019 08-54-36.png18-06-2019 08-54-50.png

 

OllieClarke
15 - Aurora
15 - Aurora

Went for an iterative macro to brute force this. Fun challenge :-)

Spoiler
challenge 79.PNG
Greg_Murray
12 - Quasar

Solution attached