Euler Problem 77
================

It is possible to write ten as the sum of primes in exactly five different ways:

    7 + 3
    5 + 5
    5 + 3 + 2
    3 + 3 + 2 + 2
    2 + 2 + 2 + 2 + 2

What is the first value which can be written as the sum of primes in over five
thousand different ways?   


```python
from sympy import sieve

N = 200
s = [0]*N
s[0] = 1
for p in sieve.primerange(1, N):
    for k in range(N-1, 0, -1):
        for i in range(k-p, -1, -p):
            s[k] += s[i]
for k in range(100):
    if s[k] > 5000:
        print(k, s[k])
        break
```

    71 5007



```python

```

aae2430679529e6bb4254c013b04904ce112677b
ipynb
Jupyter Notebook
Euler 077 - Prime summations.ipynb
Radcliffe/project-euler
5eb0c56e2bd523f3dc5329adb2fbbaf657e7fa38
MIT
2016-05-11T18:55:35.000Z
2019-12-27T21:38:43.000Z
Euler 077 - Prime summations.ipynb
Radcliffe/project-euler
5eb0c56e2bd523f3dc5329adb2fbbaf657e7fa38
MIT
Euler 077 - Prime summations.ipynb
Radcliffe/project-euler
5eb0c56e2bd523f3dc5329adb2fbbaf657e7fa38
MIT
Qwen/Qwen-72B
1. YES
2. YES