cancel
Showing results for 
Search instead for 
Did you mean: 

Challenge #79: Find the Closest Prime Number

JoeM
Alteryx Alumni (Retired)

Challenge #79: Find the Closest Prime Number

View last week's challenge HERE.

 

This week's challenge is simple to grasp, but more difficult to execute. This week, let's make an application that finds the closest prime number to a users input.

 OptimusPrime.gif

A prime number is a number that has two positive divisors - 1 and itself.

Without the use of a lookup table, please build an app that takes a user-entered number and returns the closest prime number to the entered number.

 

Fun fact:  this post went live on 07/31/2017 - a very prime day indeed!

 

Attachment
Download this attachment
Attachment
Download this attachment
Hitch
Asteroid

Re: Challenge #79: Find the Closest Prime Number

Apologies. Please ignore previous post the attachment was incomplete.

 

This time I've attached a package which includes the macro!

Attachment
Download this attachment
michael_leoni
Asteroid

Re: Challenge #79: Find the Closest Prime Number

Please see my solution below. 

Attachment
Download this attachment
Highlighted

Re: Challenge #79: Find the Closest Prime Number

Challenge 79

mikeprice17
Asteroid

Re: Challenge #79: Find the Closest Prime Number

Could have built in additional functionalities but It was my 4th challenge of the day so just happy to wrap up haha.

Attachment
Download this attachment
Tokimatsu
Quasar

Re: Challenge #79: Find the Closest Prime Number

Solved.

Spoiler
2021-01-16_10h32_18.png

Attachment
Download this attachment
Tyro_abc
11 - Bolide

Re: Challenge #79: Find the Closest Prime Number

Spoiler
arundhuti726_0-1610836865822.png

 

arundhuti726_1-1610836908913.png

 

Attachment
Download this attachment
clmc9601
13 - Pulsar

Re: Challenge #79: Find the Closest Prime Number

My solution. I am getting much more comfortable with generate rows!

Attachment
Download this attachment
BeginnerMindset
Asteroid

Re: Challenge #79: Find the Closest Prime Number

Spoiler
BeginnerMindset_0-1611781287016.png

 

Spoiler
BeginnerMindset_1-1611781346109.png

 

Attachment
Download this attachment
duartepimentel
Asteroid

Re: Challenge #79: Find the Closest Prime Number

Solution attached! Interesting one

Attachment
Download this attachment
Attachment
Download this attachment
Sashikumar
Asteroid

Re: Challenge #79: Find the Closest Prime Number

I solved but I used the solution for my understanding.

Spoiler
ch79.PNG
Attachment
Download this attachment