6 kyu

Check if number is prime without loops

270 of 366frusciante

Description:

Return true if n is prime and false if not;

like:
  isPrime(7) == true
  isPrime(-7) == true
  isPrime(6) == false
  isPrime(-6) == false

!important: n always be integer and can be negative (but you need to handle this);

you can't use loops or hardcode (for, while)

Mathematics
Restricted
Algorithms

Stats:

CreatedJan 24, 2017
PublishedJan 24, 2017
Warriors Trained969
Total Skips12
Total Code Submissions4177
Total Times Completed366
JavaScript Completions270
C# Completions109
Total Stars27
% of votes with a positive feedback rating82% of 127
Total "Very Satisfied" Votes94
Total "Somewhat Satisfied" Votes21
Total "Not Satisfied" Votes12
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • frusciante Avatar
  • user5036852 Avatar
  • Tefferson Avatar
  • Firefly2002 Avatar
  • hobovsky Avatar
  • user8436785 Avatar
Ad