user
Definition

Write down the first prime number, add the next prime number and if it is prime, add it to the series and so on. These primes are called **extreme primes**.

Task

Find and display the first **30 extreme primes** on this page.

Stretch

Find and display the **1,000th**, **2,000th**, **3,000th**, **4,000th** and **5,000th** extreme primes and for each one show the prime number **p** up to and including which primes need to be summed to obtain it.

Related (and near duplicate) tasks

* Prime numbers p for which the sum of primes less than or equal to p is prime
* Summarize primes

Reference

OEIS sequence A013918
assistant
So we're just gonna keep doing the same task over and over with slightly different names?

Primes equal to the sum of the first k primes for some k.

```
use Lingua::EN::Numbers;

say $_».&comma».fmt("%7s").batch(10).join: "\n" for
(([\+] (^∞).grep: &is-prime).grep: &is-prime)[^30,999,1999,2999,3999,4999];

```

Output:

```
      2       5      17      41     197     281   7,699   8,893  22,039  24,133
 25,237  28,697  32,353  37,561  38,921  43,201  44,683  55,837  61,027  66,463
 70,241  86,453 102,001 109,147 116,533 119,069 121,631 129,419 132,059 263,171
1,657,620,079
9,744,982,591
24,984,473,177
49,394,034,691
82,195,983,953
```

You may Attempt This Online!