Anonymous user
Safe and Sophie Germain primes: Difference between revisions
→{{header|Mathematica}} / {{header|Wolfram Language}}
Line 184:
<lang Mathematica>nextSafe[n_] :=
NestWhile[NextPrime, n + 1, ! (PrimeQ[2 # + 1] && PrimeQ[#]) &]
Labeled[Grid[Partition[NestList[nextSafe, 2, 49], 10]
Alignment -> {Right,
{{out}}<pre>
Line 193 ⟶ 194:
359 419 431 443 491 509 593 641 653 659
683 719 743 761 809 911 953 1013 1019 1031
1049 1103 1223 1229 1289 1409 1439 1451 1481 1499
=={{header|PARI/GP}}==
|