Sequence of primes by trial division: Difference between revisions
Sequence of primes by trial division (view source)
Revision as of 11:28, 4 February 2024
, 3 months ago→{{header|Wren}}: Minor tidy
VincentARM (talk | contribs) (add task to arm assembly raspberry pi) |
m (→{{header|Wren}}: Minor tidy) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 947:
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
func prime n .
break 1▼
.
i = 3
if num mod 2 = 0 and num > 2▼
while i <=
.
.
.
proc
for i = first to last
.
.
.
print seq[]
</syntaxhighlight>
Line 1,322 ⟶ 1,319:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import extensions;
import system'routines;
Line 1,328 ⟶ 1,325:
isPrime =
(n => new Range(2,(n.sqrt() - 1).RoundedInt).allMatchedBy::(i => n.mod
Primes =
(n => new Range(2, n - 2).filterBy
public program()
Line 3,413 ⟶ 3,410:
{{libheader|Wren-fmt}}
Using a simple generator.
<syntaxhighlight lang="
var primeSeq = Fiber.new {
|