Post Reply 
The calculator I always wanted
09-17-2019, 01:51 AM
Post: #9
RE: The calculator I always wanted
(09-16-2019 08:33 PM)vanLudwig Wrote:  I wondered for which integers n is the sum of the first n primes itself prime? 2 is prime. 2+3=5 is prime. 2+3+5=10 is not. 2+3+5+7=17 is prime. 2+3+5+7+11=28 is not. Turns out, it happens a lot.
$$\texttt{Select}\left ( \left \{ n \right \}_{n=1}^{2500}, n \mapsto \sum_{i=1}^{n} p_{i}\in \mathbb{P} \right )$$

Very nice. You can make it run faster by noticing that, apart from the initial "1", n must necessarily be even.

V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
The calculator I always wanted - vanLudwig - 09-08-2019, 04:29 PM
RE: The calculator I always wanted - Valentin Albillo - 09-17-2019 01:51 AM
RE: The calculator I always wanted - EdS2 - 09-17-2019, 08:25 AM



User(s) browsing this thread: 2 Guest(s)