Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

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

JamesCameron
8 - Asteroid

My Effort

 

Spoiler
JamesCameron_0-1576757417159.png
nini
8 - Asteroid

I try to find the closest prime number less than or larger than the given number using batch macros

nini
8 - Asteroid

not batch macro, iterative macro

Carlithian
11 - Bolide
11 - Bolide

Ah, love an excuse for an iterative macro 🙂

ArnavS
Alteryx
Alteryx
 
rmassambane
10 - Fireball
 
danicahui
8 - Asteroid
Spoiler
1. Standard macro defining whether a number is prime
Challenge 79a 2020-01-20.jpg

2. Iterative macro to find the closest prime number above (and another for below)
Challenge 79b 2020-01-20.jpg

3. App to find closest prime
Challenge 79c 2020-01-20.jpg
mbogusz
9 - Comet
Spoiler
2020-01-26 16_36_36-Greenshot.png
ImranA
8 - Asteroid

really enjoyed this one, interesting challenge! shame there isn't much of a practical application!

 

Spoiler
ImranA_0-1580745171265.png
JennyMartin
9 - Comet
Spoiler
AWC79.1.PNGAWC79.2.PNG

Really fun challenge! I will say that the macro I built will always favour the higher number if there are prime numbers equidistant from the inputted number e.g. if the user enters 4 then it will return 5 rather than 3.