Prime numbers p for which the sum of primes less than or equal to p is prime: Difference between revisions
Content added Content deleted
Line 279: | Line 279: | ||
Total such primes < 1000: 21 |
Total such primes < 1000: 21 |
||
</pre> |
|||
=={{header|Mathematica}} / {{header|Wolfram Language}}== |
|||
<lang Mathematica>cands = Most@NestWhileList[NextPrime, 2, # < 1000 &]; |
|||
Partition[ |
|||
cands[[Flatten@Position[PrimeQ /@ Accumulate[cands], True]]], |
|||
UpTo[5]] // TableForm</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> |
</pre> |
||