Is Prime
Return True if n is a prime number (a whole number above 1 whose only divisors are 1 and itself), otherwise False.
Example 1
n 13
returns true
Only 1 and 13 divide it.
Example 2
n 15
returns false
Divisible by 3 and 5.
Constraints
0 <= n <= 10**4
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Lattice Points in a CircleBeginner
- Leap YearBeginner
- Matches in a TournamentBeginner
- Number of Common FactorsBeginner
- Power of FourBeginner
- Power of ThreeBeginner
- Power of TwoBeginner
- Product Minus Sum of DigitsBeginner