Jump to content

Sequence of primes by trial division: Difference between revisions

PascalABC.NET
m (→‎{{header|Wren}}: Minor tidy)
(PascalABC.NET)
 
Line 2,482:
;output:
<pre> 1000000007 1000000009 1000000021 1000000033 1000000087 1000000093 1000000097</pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
##
function IsPrime(n: integer) := (2..n.Sqrt.Round).All(i -> n.NotDivs(i));
 
(2..100).Where(IsPrime).Println
</syntaxhighlight>
{{out}}
<pre>
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</pre>
 
 
=={{header|Perl}}==
170

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.