===== ISTEM =====
Solve the following programming task.

TASK: Prime Number Check

Write a function 'is_prime(n)' that checks whether the given integer is prime. 1 and negative numbers are not prime. It must run in O(sqrt(n)) time.

STARTER CODE (python):
def is_prime(n: int) -> bool:
    # Write your code here
    pass


RULES:
- Keep the function name and signature EXACTLY as given.
- Return working code only. No explanations.
- Put the code in a single ``` block.
- Try to solve it first. If you genuinely cannot, write only this single
  line instead of producing faulty code: CANNOT_SOLVE

===== HAM YANIT =====
```python
def is_prime(n: int) -> bool:
    if n <= 1:
        return False
    if n <= 3:
        return True
    if n % 2 == 0 or n % 3 == 0:
        return False
    i = 5
    step = 2
    limit = int(n ** 0.5) + 1
    while i <= limit:
        if n % i == 0:
            return False
        i += step
        step = 6 - step  # alternate between adding 2 and 4 (checks 6k±1)
    return True
```