[INST] Write an efficient function to check if an integer is a prime number./n [/INST]  ###Response: Sure, here's an example implementation of a function:

```
def is_prime(n):
    if n <= 1:
        return False
    
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    
    return True
```

Here's how this function works:

1. We first check if the input integer `n` is less than or equal to 1, because we know that 1 and all negative numbers are not prime. If `n` is 1 or less, we return `False`.
2. We then loop from 2 to the square root of `n` (rounded up to the nearest integer using `int(n**0.5) + 1`), because any factor of `n` greater than the square root of `n` would necessarily have a corresponding factor less than the square root of `n`. For each number `i` in this range, we check if `n` is evenly divisible by `i`. If it is, then `n` is not prime and we can return `False`.
3. If we've finished looping through all possible factors of `n` without finding any that divide it evenly, then `n` must be prime and we can return `True`.