Anonymous user
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 20:54, 20 December 2021
, 2 years ago→{{header|Julia}}
Line 279:
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>
|