Sieve of Eratosthenes: Difference between revisions

no edit summary
No edit summary
Line 1,323:
The last expression computes the number of primes < 1e0 1e1 ... 1e9.
The last number 50847534 can perhaps be called the anti-Bertelsen's number (http://mathworld.wolfram.com/BertelsensNumber.html).
 
=== Rotations ===
 
<syntaxhighlight lang="apl">PRIMES←{{1⊖⍵~(1↑⍵)×1↓⍳⍴⍵}⍣{2=1↑⍺}1↓⍳⍵}</syntaxhighlight>
 
{{out}}
<pre>
PRIMES 9
3 5 7
</pre>
 
====Step by step====
 
<pre>
A: [2] 3 4 5 6 7 8 9
B: 3 5 7 9 [2]
C: 5 7 [2] 3
D: 7 [2] 3 5
E: [2] 3 5 7
</pre>
 
=={{header|AppleScript}}==
422

edits