```
def check_goldbach_for_num(n, primes_set):
    primes_set = sorted(primes_set)
    left = 0
    right = len(primes_set) - 1
    index_s = None
    index_b = None
    while left <= right:
        mid = (left + right) // 2
        if n == primes_set[mid]:
            return "number is prime"
        elif right == left:
            if n > mid:
                index_s = mid
                break
            else:
                index_b = mid
        elif n < primes_set[mid]:
            if n > primes_set[mid - 1]:
                index_b = mid
                index_s = mid - 1
                break
            right = mid - 1
        else:
            if n < primes_set[mid + 1]:
                index_b = mid + 1
                index_s = mid
                break
            left = mid + 1
    for i in range(0, len(primes_set) - 1):
        if n-primes_set[i] in primes_set:
            return True
    return False


```


```
from sympy.ntheory.generate import primerange
primes = set(primerange(50,1000))
check_goldbach_for_num(116, primes)
```

bd4fc1cce433dacb2f79a772317efdcbaef03cfe
ipynb
Jupyter Notebook
demo/goldbach/submissions/1.ipynb
chrispyles/pybryt
23f8bfce3179638ec5b4efe3555d3bb4e7321dc0
MIT
2021-02-17T20:45:17.000Z
2022-03-16T19:39:00.000Z
demo/goldbach/submissions/1.ipynb
chrispyles/pybryt
23f8bfce3179638ec5b4efe3555d3bb4e7321dc0
MIT
2021-03-05T01:11:45.000Z
2022-03-23T04:08:58.000Z
demo/goldbach/submissions/1.ipynb
chrispyles/pybryt
23f8bfce3179638ec5b4efe3555d3bb4e7321dc0
MIT
2021-02-14T04:27:34.000Z
2022-03-03T07:29:49.000Z
Qwen/Qwen-72B
1. YES
2. YES