as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
design an algorithm to determine whether a given number is prime.
user
we can use the following algorithm to determine whether a given number, n, is prime or not:
1. set a counter, i, to 2.
2. check if n is evenly divisible by i. if n is evenly divisible by i, n is not a prime number. if n is not evenly divisible by i, increment i by 1 and go back to step 2.
3. if i is greater than or equal to the square root of n, then n is a prime number.
assistant