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

Inactive User
Not applicable
 
Laurap1228
11 - Bolide

Here is my solution. I translated this from a python algorithm I wrote.

 

 

pasccout
8 - Asteroid

Here is my solution

jssandom
8 - Asteroid

My solution

 

79.JPG

 

 

kelly_gilbert
13 - Pulsar
Spoiler
I chose the nested macro approach.

Outer workflow:
challenge_79_workflow.PNG


Outer macro (finds the nearest prime number):
challenge_79_macro_find_nearest_prime.PNG


Inner macro (tests whether or not a number is prime):
challenge_79_macro_is_prime.PNG
justynam
8 - Asteroid

 

I implemented one iterative macro - Sieve of Eratosthenes to find all prime numbers within range 2 - 2*Number

Then finding Prime Number closest to Number is easy.

Spoiler
 

Iterative macro - Sieve of Eratosthenes

New Picture (10).jpg

 

justynam
8 - Asteroid

and the file with the solution

OldDogNewTricks
10 - Fireball

Attached is my solution.  I created an app that takes a number and finds the closest prime above and below the given number.  I'm using a Python node to do the heavy lifting. 

 

The result looks like this:

challenge_79_SS_result.jpg

 

 

Spoiler
completed_79_SS_workflow.jpg
ipeng
8 - Asteroid

Solution attached!

RichoBsJ
11 - Bolide

Cooool challenge :)

Here my prime calculator app!

 

Spoiler
app.PNGmacro.PNG