Prime numbers p for which the sum of primes less than or equal to p is prime: Difference between revisions
Prime numbers p for which the sum of primes less than or equal to p is prime (view source)
Revision as of 21:45, 20 December 2021
, 2 years agoAdd J
Not a robot (talk | contribs) (Add J) |
|||
Line 239:
Found 21 such primes
</pre>
=={{header|J}}==
<lang j>(+#~1:p:+/\)@(i.&.(p:^:_1)) 1000</lang>
{{out}}
<pre>2 3 7 13 37 43 281 311 503 541 557 593 619 673 683 733 743 839 881 929 953</pre>
=={{header|Julia}}==
Line 280 ⟶ 285:
Total such primes < 1000: 21
</pre>
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<lang Mathematica>cands = Most@NestWhileList[NextPrime, 2, # < 1000 &];
|