In this Kata, you will be given a number and your task will be to return the nearest prime number. 
```Haskell
solve(4) = 3. The nearest primes are 3 and 5. If difference is equal, pick the lower one. 
solve(125) = 127
```
We'll be testing for numbers up to `1E10`. `500` tests.
More examples in test cases. 
Good luck!
If you like Prime Katas, you will enjoy this Kata: [Simple Prime Streaming](https://www.codewars.com/kata/5a908da30025e995880000e3)
def solve(n):
    i = 2
    if n%2==0:
        i = 1
    if IsPrime(n):
        return n
    while True:
        temp = n-i
        if IsPrime(temp):
            return temp
        temp = n+i
        if IsPrime(temp):
            return temp
        i+=2

def IsPrime(n):
    if n %2 ==0:
        return False
    for i in range(3,int(n**0.5),2):
        if n % i == 0:
            return False
    return True
def solve(n):
    i = 2
    if n%2==0:
        i = 1
    if IsPrime(n):
        return n
    while True:
        temp = n-i
        if IsPrime(temp):
            return temp
        temp = n+i
        if IsPrime(temp):
            return temp
        i+=2

def IsPrime(n):
    if n %2 ==0:
        return False
    for i in range(3,int(n**0.5),2):
        if n % i == 0:
            return False
    return True