#so i was instructed to find if random is prime or not...

1 messages · Page 1 of 1 (latest)

obtuse basinBOT
#

<@&987246399047479336> please have a look, thanks.

open helm
#

my brain froze for almost 20 mins

#

and i still haven't solved it...

spiral shadow
mortal bloom
random berry
#

Well figure out what the base cases would be.

#

Once you know the base cases it really only takes a very short and simple couple lines of codes. Think what a prime number can't do that a non-prime can do.

#

once you figure out what seperates them it should click pretty quick

#

If you can't figure it out I'll put a spoiler that will lead you in the right direction but you should try and figure it out for yourself as this is really basic and just requires you to sit down and think for a bit. If you can't get this it's only going to get exponentially harder.

#

||A Prime number cannot be divisible by any number between 1 and itself, let's say the number is n the range for it would be 2,n-1 which is what it cannot be divided by||