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

CeliaC_Silje
8 - Asteroid

App:

Spoiler
Check if the number is prime number, if not, run the 2 macros parallelly to find previous and next prime number.
CeliaC_Silje_0-1679373916366.png

Macros:

Spoiler
The 2 iterative macros are similar, just the difference in finding previous/ next number
CeliaC_Silje_1-1679373986865.png

I wasted so much time in simplifying the app and macros 😑 - just realize it is better to get the result first.

Hammad_Rashid
11 - Bolide

79.JPG

geoff_zath
Alteryx
Alteryx
Spoiler

geoff_zath_0-1682118313837.png

 

chandler-gjino
Alteryx
Alteryx

attaching my solution

jerviss53
8 - Asteroid

Solution attached

mithily
8 - Asteroid

Did an app using generate rows

Spoiler
generate rows
ed_hayter
12 - Quasar
Spoiler
Very Fun Challenge.
Logic was to go with nested iterative macro. The inner macro takes a given number and divides it by all numbers less than selected number. Then checks the mod value for all of these. If only two records have mod of 0 the number is prime.
I wrapped the logic in an iterative macro that said if the information returned indicated the number was not prime - run it again with the number + or - 1 (so two different iterative macros one going up one going down).

Finally did a join multiple to the original number and checked for the closest prime number.


Challenge 73 Nested Iterative Macro Image.pngChallenge 79 App Image.pngChallenge 79 Outer Iterative Macro Image.png
gawa
15 - Aurora
15 - Aurora

After I created WF, I forgot to consider about the given number is already a pirme number, and re-built it somehow.

Spoiler
image.png
Sebastian_Chaieb2
8 - Asteroid
8 - Asteroid

I love it :)

 

Spoiler
79.PNG

79_App.PNG

lwolfie
10 - Fireball

Not the prettiest but it works.