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

Jean-Balteryx
16 - Nebula
16 - Nebula

Here is my solution !

phottovy
13 - Pulsar
13 - Pulsar

Really curious to see how others completed this one:

Spoiler
79.PNG
danuliatko
7 - Meteor

My solution attached - i am sure it can be done more quickly

JethroChen
10 - Fireball
Spoiler
challenge_79_jc.PNG
HarrisonHolt
7 - Meteor

wc79

ehughes
9 - Comet

Really nice challenge

Spoiler
Img 79.pngImg 79 - macro.png

  

AkimasaKajitani
17 - Castor
17 - Castor

My solution.

 

Spoiler
1. Calculate the Lower Prime Number
2. Calculate the diff between Lower Prime Number and Number.
3. Calculate the Upper Prime Number between Number and Number+diff.
4. Select the Prime Number that have most minimum diff.  

AkimasaKajitani_0-1603512052885.png

 

Qiu
20 - Arcturus
20 - Arcturus

Very interesting

Spoiler
en-79.PNG
Hitch
8 - Asteroid

Here's my attempt

A2H
11 - Bolide

This solution works also for large numbers!

Spoiler
Capture d’écran, le 2020-11-17 à 00.12.49.png